diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-15 10:21:05 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-15 10:30:59 -0300 |
commit | c546875daf36936b9a6c0886a71c9edd1fdae6db (patch) | |
tree | b20e159ef39a89e67c0a7738d96ef1f4afccd284 /src/nvim/ex_getln.c | |
parent | dbe719317cf71dd1951d8d478256b8735db12db0 (diff) | |
download | rneovim-c546875daf36936b9a6c0886a71c9edd1fdae6db.tar.gz rneovim-c546875daf36936b9a6c0886a71c9edd1fdae6db.tar.bz2 rneovim-c546875daf36936b9a6c0886a71c9edd1fdae6db.zip |
ui: Replace cursor_{on,off} by busy_{stop,start}
Switching cursor off is only necessary in two occasions:
- When redrawing to avoid terminal flickering
- When the editor is busy
The first can now be handled by the TUI, so most calls to ui_cursor_off can be
removed from the core.
So, before this commit it was only necessary to switch the cursor off to notify
the user that nvim was running some long operation. Now the cursor_{on,off}
functions have been replaced by busy_{stop,start} which can be handled in a
UI-specific way(turning the cursor off or showing a busy indicator, for
example).
To make things even more simpler, nvim is always busy except when waiting for
user input or other asynchronous events: It automatically switches to a non-busy
state when the event loop is about to be entered for more than 100 milliseconds.
`ui_busy_start` can be called when its not desired to change the busy state in
the event loop (As its now done by functions that perform blocking shell
invocations).
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index a7bb4afa70..c9e990b713 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1364,7 +1364,6 @@ cmdline_changed: if (ccline.cmdlen == 0) i = 0; else { - ui_cursor_off(); /* so the user knows we're busy */ ui_flush(); ++emsg_off; /* So it doesn't beep if bad expr */ /* Set the time limit to half a second. */ @@ -1701,10 +1700,6 @@ getexmodeline ( char_u *p; int prev_char; - /* Switch cursor on now. This avoids that it happens after the "\n", which - * confuses the system function that computes tabstops. */ - ui_cursor_on(); - /* always start in column 0; write a newline if necessary */ compute_cmdrow(); if ((msg_col || msg_didout) && promptc != '?') |