Commit Graph

156 Commits

Author SHA1 Message Date
Maxime Coste
4fc20b8d7d Rework client quitting and handling of remote errors
Client quitting no longer immediately unwinds, client is just pushed
for deletion until we get back to the main loop, similarly to what
happens for buffer and window deletion.
2016-09-04 17:56:07 +01:00
Maxime Coste
439f168928 Use named keys for Return and Tab instead of <c-m> and <c-i>
Fixes #722
2016-07-05 20:08:13 +01:00
Maxime Coste
34c8e6a9cf Clear up info/menus and eventual prompts when reseting to normal mode
Fixes #697
2016-06-16 19:35:43 +01:00
Maxime Coste
3b6d6956e2 We do need a force redraw on resize for menu, info and status bar 2016-05-16 10:23:47 +01:00
Maxime Coste
ba421e45f7 Delay window deletion until we get back to main loop
Avoid WinResize hooks while redrawing, ensure window resize only
take place while handling user input.

Fixes #672
2016-05-14 08:17:52 +01:00
Maxime Coste
d3aff03062 Keep a pointer to current client in windows so that window hooks can access it 2016-05-09 13:48:48 +01:00
Maxime Coste
815924e4da Merge remote-tracking branch 'lenormf/buffer-padding' 2016-04-11 13:44:10 +01:00
Maxime Coste
9b4bd611ef Replace menu and info when they actually moved
Previous logic worked only when the buffer moved in the window, but
not if some highlighter (like line numbering or flag lines) moved
the text around.
2016-03-30 19:46:43 +01:00
Maxime Coste
9e15181dc9 Rework container helpers, use pipe syntax and cleanup implementation
use 'container | filter(func) | reverse() | transform(func)' instead
of 'transform(reverse(filter(container), func), func)' to express
container transformations.
2016-03-08 21:35:56 +00:00
Maxime Coste
3cbc0d0b39 Force redraw everything, not just refresh 2016-03-08 13:42:00 +00:00
Maxime Coste
6c8f8fe691 Rework client redrawing, delay menu/info methods until next refresh
That avoid sending lots of spurious info_hide/menu_hide, just set
a flag and wait until the client is asked to redraw.
2016-03-07 23:11:59 +00:00
Maxime Coste
2626ce858f Move <c-l> handling to normal mode from client
Client handling prevents :exec from triggering a redraw
2016-03-07 22:14:03 +00:00
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
Frank LENORMAND
f408cf7ed3 Allow users to chose how the buffers are padded 2016-02-17 15:48:09 +02: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