aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-11-21 15:34:18 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-21 15:41:02 -0300
commitf09a33bbc131138f67aa13752559ade2d4e577c2 (patch)
treed204eca11f8ea4fa128016f68a1bc0f8af62ff18 /src/nvim/ex_getln.c
parent230c935e73c0eb8359b18f0da9ce2238cd7830bc (diff)
downloadrneovim-f09a33bbc131138f67aa13752559ade2d4e577c2.tar.gz
rneovim-f09a33bbc131138f67aa13752559ade2d4e577c2.tar.bz2
rneovim-f09a33bbc131138f67aa13752559ade2d4e577c2.zip
event: No longer process K_EVENT automatically
Two new functions, `event_enable_deferred()`/`event_disable_deferred()` have to be called by code that is capable of handling asynchronicity. User-dialog states like "press ENTER to continue" or the swap file confirmation no longer will generate K_EVENT.
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 5feff4d456..2be3757821 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -311,9 +311,16 @@ getcmdline (
/* Get a character. Ignore K_IGNORE, it should not do anything, such
* as stop completion. */
+ event_enable_deferred();
do {
c = safe_vgetc();
} while (c == K_IGNORE);
+ event_disable_deferred();
+
+ if (c == K_EVENT) {
+ event_process();
+ continue;
+ }
if (KeyTyped) {
some_key_typed = TRUE;
@@ -769,11 +776,6 @@ getcmdline (
* Big switch for a typed command line character.
*/
switch (c) {
- case K_EVENT:
- event_process();
- // Force a redraw even though the command line didn't change
- shell_resized();
- goto cmdline_not_changed;
case K_BS:
case Ctrl_H:
case K_DEL:
@@ -1885,8 +1887,6 @@ redraw:
}
if (IS_SPECIAL(c1)) {
- // Process deferred events
- event_process();
// Ignore other special key codes
continue;
}