diff options
author | watiko <service@mail.watiko.net> | 2016-01-18 10:04:11 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-01 03:43:37 +0900 |
commit | 9664f513f476b896f81451e1427fc47a60ecea96 (patch) | |
tree | 2f8745556be5d99dac6e7a3ebd6e7fe50961aecf | |
parent | d21aaef4560e73d3a1e008abb72924a01fa57c14 (diff) | |
download | rneovim-9664f513f476b896f81451e1427fc47a60ecea96.tar.gz rneovim-9664f513f476b896f81451e1427fc47a60ecea96.tar.bz2 rneovim-9664f513f476b896f81451e1427fc47a60ecea96.zip |
vim-patch:7.4.807
Problem: After CTRL-V CTRL-A mode isn't updated. (Hirohito Higashi)
Solution: Clear the command line or update the displayed command.
https://github.com/vim/vim/commit/0bbcb5c8efbfe5f1568f56b24ffd222d915916f6
-rw-r--r-- | src/nvim/normal.c | 27 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 17 insertions, 12 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 23e2e634cc..9a1d99162f 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1705,10 +1705,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) VIsual_active = false; setmouse(); mouse_dragging = 0; - if (mode_displayed) - clear_cmdline = true; /* unshow visual mode later */ - else - clear_showcmd(); + may_clear_cmdline(); if ((oap->op_type == OP_YANK || oap->op_type == OP_COLON || oap->op_type == OP_FUNCTION @@ -2852,10 +2849,7 @@ void end_visual_mode(void) if (!virtual_active()) curwin->w_cursor.coladd = 0; - if (mode_displayed) - clear_cmdline = true; /* unshow visual mode later */ - else - clear_showcmd(); + may_clear_cmdline(); adjust_cursor_eol(); } @@ -3149,10 +3143,19 @@ static void unshift_special(cmdarg_T *cap) cap->cmdchar = simplify_key(cap->cmdchar, &mod_mask); } -/* - * Routines for displaying a partly typed command - */ +/// If the mode is currently displayed clear the command line or update the +/// command displayed. +static void may_clear_cmdline(void) +{ + if (mode_displayed) { + // unshow visual mode later + clear_cmdline = true; + } else { + clear_showcmd(); + } +} +// Routines for displaying a partly typed command # define SHOWCMD_BUFLEN SHOWCMD_COLS + 1 + 30 static char_u showcmd_buf[SHOWCMD_BUFLEN]; static char_u old_showcmd_buf[SHOWCMD_BUFLEN]; /* For push_showcmd() */ @@ -3532,6 +3535,7 @@ static void nv_help(cmdarg_T *cap) static void nv_addsub(cmdarg_T *cap) { bool visual = VIsual_active; + if (cap->oap->op_type == OP_NOP && do_addsub((int)cap->cmdchar, cap->count1, cap->arg) == OK) { if (visual) { @@ -3549,6 +3553,7 @@ static void nv_addsub(cmdarg_T *cap) if (visual) { VIsual_active = false; redo_VIsual_busy = false; + may_clear_cmdline(); redraw_later(INVERTED); } } diff --git a/src/nvim/version.c b/src/nvim/version.c index 9dd943d74b..e41d1ff7ce 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -327,7 +327,7 @@ static int included_patches[] = { // 810, 809, // 808 NA - // 807, + 807, 806, // 805, // 804, |