mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
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)
2455c4ede8
This commit is contained in:
parent
44024f2c65
commit
5b263ac6ad
@ -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;
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ static int included_patches[] = {
|
||||
// 873 NA
|
||||
// 872 NA
|
||||
// 871,
|
||||
// 870,
|
||||
870,
|
||||
// 869 NA
|
||||
868,
|
||||
// 867 NA
|
||||
|
Loading…
Reference in New Issue
Block a user