diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-20 19:11:25 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-20 19:15:13 +0100 |
commit | 5b263ac6adf76b025aed9c2edd30dbc35dd4e8cc (patch) | |
tree | dd425a304377a088d81bbcd3e60a7436e9ceeee9 /src | |
parent | 44024f2c65d98bb0956e7d126a695247ecca023b (diff) | |
download | rneovim-5b263ac6adf76b025aed9c2edd30dbc35dd4e8cc.tar.gz rneovim-5b263ac6adf76b025aed9c2edd30dbc35dd4e8cc.tar.bz2 rneovim-5b263ac6adf76b025aed9c2edd30dbc35dd4e8cc.zip |
vim-patch:7.4.870
Problem: May get into an invalid state when using getchar() in an
expression mapping.
Solution: Anticipate mod_mask to change. (idea by Yukihiro Nakadaira)
https://github.com/vim/vim/commit/2455c4ede8d4ff6f0754977b548708eec08869eb
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/getchar.c | 10 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 89d22ad811..73b3de0b5d 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1380,13 +1380,15 @@ int vgetc(void) } else { mod_mask = 0x0; last_recorded_len = 0; - for (;; ) { /* this is done twice if there are modifiers */ - if (mod_mask) { /* no mapping after modifier has been read */ + for (;; ) { // this is done twice if there are modifiers + bool did_inc = false; + if (mod_mask) { // no mapping after modifier has been read ++no_mapping; ++allow_keys; + did_inc = true; // mod_mask may change value } - c = vgetorpeek(TRUE); - if (mod_mask) { + c = vgetorpeek(true); + if (did_inc) { --no_mapping; --allow_keys; } diff --git a/src/nvim/version.c b/src/nvim/version.c index 7d4b8982cd..813448ca40 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -420,7 +420,7 @@ static int included_patches[] = { // 873 NA // 872 NA // 871, - // 870, + 870, // 869 NA 868, // 867 NA |