diff options
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 9ec97bd320..0a43d59607 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -57,9 +57,11 @@ #include "nvim/tag.h" #include "nvim/term.h" #include "nvim/ui.h" +#include "nvim/mouse.h" #include "nvim/undo.h" #include "nvim/window.h" #include "nvim/os/event.h" +#include "nvim/os/time.h" /* * The Visual area is remembered for reselection. @@ -312,7 +314,6 @@ static const struct nv_cmd { {K_F8, farsi_fkey, 0, 0}, {K_F9, farsi_fkey, 0, 0}, {K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0}, - {K_EVENT, nv_event, NV_KEEPREG, 0}, }; /* Number of commands in nv_cmds[]. */ @@ -483,7 +484,15 @@ normal_cmd ( /* * Get the command character from the user. */ + event_enable_deferred(); c = safe_vgetc(); + event_disable_deferred(); + + if (c == K_EVENT) { + event_process(); + return; + } + LANGMAP_ADJUST(c, true); /* @@ -708,9 +717,6 @@ getcount: bool lit = false; /* get extra character literally */ bool langmap_active = false; /* using :lmap mappings */ int lang; /* getting a text character */ -#ifdef USE_IM_CONTROL - bool save_smd; /* saved value of p_smd */ -#endif ++no_mapping; ++allow_keys; /* no mapping for nchar, but allow key codes */ @@ -759,12 +765,6 @@ getcount: State = LANGMAP; langmap_active = true; } -#ifdef USE_IM_CONTROL - save_smd = p_smd; - p_smd = false; /* Don't let the IM code show the mode here */ - if (lang && curbuf->b_p_iminsert == B_IMODE_IM) - im_set_active(true); -#endif *cp = plain_vgetc(); @@ -774,14 +774,6 @@ getcount: ++allow_keys; State = NORMAL_BUSY; } -#ifdef USE_IM_CONTROL - if (lang) { - if (curbuf->b_p_iminsert != B_IMODE_LMAP) - im_save_status(&curbuf->b_p_iminsert); - im_set_active(false); - } - p_smd = save_smd; -#endif State = NORMAL_BUSY; need_flushbuf |= add_to_showcmd(*cp); @@ -1001,8 +993,8 @@ getcount: cursor_on(); out_flush(); if (msg_scroll || emsg_on_display) - ui_delay(1000L, true); /* wait at least one second */ - ui_delay(3000L, false); /* wait up to three seconds */ + os_delay(1000L, true); /* wait at least one second */ + os_delay(3000L, false); /* wait up to three seconds */ State = save_State; msg_scroll = false; @@ -7382,8 +7374,3 @@ static void nv_cursorhold(cmdarg_T *cap) did_cursorhold = true; cap->retval |= CA_COMMAND_BUSY; /* don't call edit() now */ } - -static void nv_event(cmdarg_T *cap) -{ - event_process(); -} |