Commit Graph

143 Commits

Author SHA1 Message Date
Maxime Coste
f1fb2114da Handle <c-l> redrawing on the server side
That way we can force a redraw at any moment, including during
batch execution.
2016-03-07 21:44:50 +00:00
Maxime Coste
72b6340b35 Only call UserInterface::refresh when the UI has been modified 2016-03-06 15:12:36 +00:00
Maxime Coste
068ca08b4c Use the general code path for reload info box handling in Client 2016-03-02 13:14:21 +00:00
Maxime Coste
3987463e75 Remove direct access to ui, go through client
Client can now update menu/info positions when the window move
around.
2016-02-27 17:23:13 +00:00
Maxime Coste
d2b0dba39d Support quitting while executing RuntimeError hooks
Fixes #529
2015-12-14 19:06:30 +00:00
Maxime Coste
5e4f5cd2a0 Move enum option handling in enum.hh and refactor enum options 2015-11-20 09:06:53 +00:00
Maxime Coste
6840f7ce9c Store the last used buffer in clients
Fixes #474
2015-11-07 18:25:49 +00:00
Maxime Coste
76fadd8108 More cleanups in the buffer open/reload code 2015-10-17 11:33:09 +01:00
Maxime Coste
3795ff735a Refactor buffer creation and reloading to be more explicit
Reloading used to be implicit in the buffer creation function,
which is not always nice, as code that explicitely wanted to
reload a buffer could not say so.
2015-10-17 11:33:09 +01:00
Maxime Coste
7776c38755 Detect ungraceful exits, and backup modified buffers in these cases 2015-10-08 13:43:39 +01:00
Maxime Coste
e2720f1fbe Store timespec for buffer fs timestamps, not just time_t
time_t has a resolution of one second, which cause troubles when
a file changes multiple time during that same second.
2015-09-27 11:55:34 +01:00
Maxime Coste
2b4b73ae8e Remove the default_face parameter of parse_display_line
No need to define a default face there, we will pass a default face
to UserInterface::draw_status later.
2015-09-20 11:34:13 +01:00
Maxime Coste
f59108072f Initial support for user configurable modeline with the modelinefmt option
modelinefmt is first sent through a command line expander (so %sh{...},
%val{...} et al. are expanded), then through markup expand (so that
{face} are interpreted as well)
2015-09-19 12:43:39 +01:00
Maxime Coste
d2c4d22d1f Keep it simple, remove all that sorted id map thing 2015-09-18 13:52:32 +01:00
Maxime Coste
36828e6059 IdMaps can be sorted, in which case the find method uses a binary search 2015-09-16 22:22:51 +01:00
Maxime Coste
693d9a4861 Store key hash in IdMap 2015-09-16 20:02:12 +01:00
Maxime Coste
0755366cb1 Rework resize handling
Fixes #383
2015-08-23 15:18:18 +01:00
Maxime Coste
ae839fc471 Remove Client::window() method, use a force_redraw() one
We cannot assume Client::m_window is always non-null, as when
changing current buffer its temporarily null, at the point
where WinCreate hook might get called.

Fixes #382
2015-08-23 13:29:24 +01:00
Maxime Coste
3f493fa186 Rename Disableable to more general NestedBool
A NestedBool can be set multiple times, and will be considered false
only when unset the same number.
2015-08-18 23:17:56 +01:00
Maxime Coste
3019118b10 Style tweak in client.cc 2015-07-22 13:30:03 +01:00
Maxime Coste
10f4bb5872 Add support for FocusIn/FocusOut events from UI 2015-07-15 13:56:31 +01:00
Maxime Coste
3fe8446065 Use StatusLine face as default for the status line 2015-06-29 22:48:26 +01:00
Maxime Coste
fa4c486b69 Always redraw status when redrawing the main window
That is needed so that on resize the status line does not disappear
2015-06-24 13:35:46 +01:00
Maxime Coste
7e6b02f26a Refactor slightly window redrawing 2015-06-22 13:34:22 +01:00
Maxime Coste
3834440298 Rework window redraw handling, should redraw window less often 2015-06-21 19:56:23 +01:00
Maxime Coste
bf46870ff2 Move status/mode line drawing as a separate ui method 2015-06-17 21:28:02 +01:00
Maxime Coste
7bff1b782e Merge branch 'mode-stack' 2015-06-05 13:16:31 +01:00
Maxime Coste
d6d81607ed Gracefully handle reloading a file that was deleted 2015-06-05 13:11:04 +01:00
Maxime Coste
f0886ad323 Get rid of the mode trash, delete mode directly when leaving on_key 2015-06-03 20:03:06 +01:00
Maxime Coste
8f6fc6a0f3 Port even more code to use format function 2015-06-01 21:15:59 +01:00
Maxime Coste
cf7b64ba67 Preserve selections across reloads 2015-05-16 11:42:58 +01:00
Maxime Coste
1dfa2d7fe4 Avoid unneeded update of selections when we are going to overwrite them 2015-04-19 15:12:16 +01:00
Maxime Coste
519254dfdc More useage of the format function 2015-03-30 23:56:33 +01:00
Maxime Coste
2747c4dd3e exception::what returns a StringView rather than a const char* 2015-03-13 13:15:51 +00:00
Maxime Coste
3c1a325b6f Refactor String, use a common StringOps interface, hide std::string 2015-03-10 19:50:22 +00:00
Maxime Coste
c0e4268e17 Reactivate direct file change check on entering normal mode 2015-03-04 20:46:26 +00:00
Maxime Coste
224f73d72a Cleanup and refactor externally modified buffer reloading
* Correctly hide the reload dialog in every client.
* Correctly handle buffer being deleted.
2015-02-12 19:18:03 +00:00
Maxime Coste
6658d15741 Allow <ret> and <esc> to reload/keep an externally modified file
Fixes #113
2015-02-11 13:56:45 +00:00
Maxime Coste
955d1dea66 Small formatting fixes 2014-12-29 12:19:16 +00:00
Maxime Coste
5b94b73152 Small code tweak 2014-12-20 18:40:17 +00:00
Maxime Coste
1c8ee78d1a Do not register timers for transient input handlers 2014-12-18 23:12:58 +00:00
Maxime Coste
87d312b6d4 More string cleanups 2014-12-08 13:59:29 +00:00
Maxime Coste
1c5975835e Consolidate constext disablable feature in a 'Disableable' helper 2014-12-05 13:47:09 +00:00
Maxime Coste
a3b3001d8f Rework client pending key handling, fix insert/normal timers 2014-11-29 20:14:52 +00:00
Maxime Coste
75fe9a76db Fix compilation 2014-11-28 13:47:42 +00:00
Maxime Coste
7c87abe856 Process ctrl-c when not in urgent event mode as well 2014-11-28 13:30:58 +00:00
Maxime Coste
49931fbf05 Separate events between normal and urgent ones
Run urgent ones while executing %sh blocks.

Fixes #236
2014-11-25 13:52:06 +00:00
Maxime Coste
0c3acb74c2 Remove unneeded string copies 2014-11-17 19:38:30 +00:00
Maxime Coste
b2407d9dfa Add ui_options option for UserInterface configuration
ui_options is a std::unordered_map<String, String> that gets
forwarded to the user interface. Add support ncurses_status_on_top.
2014-11-10 23:29:16 +00:00
Maxime Coste
88aa707b9c For {Menu,Info}Style::Prompt, choose the anchor directly in ncurses code 2014-11-08 19:08:23 +00:00