diff options
-rw-r--r-- | src/nvim/getchar.c | 3 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 465c41457a..44e4e09486 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1936,7 +1936,8 @@ static int vgetorpeek(int advance) } if ((mp == NULL || max_mlen >= mp_match_len) - && keylen != KEYLEN_PART_MAP) { + && keylen != KEYLEN_PART_MAP + && !(keylen == KEYLEN_PART_KEY && c1 == ui_toggle[0])) { // No matching mapping found or found a non-matching mapping that // matches at least what the matching mapping matched keylen = 0; diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index a8a49cd378..0522d59c9a 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -182,6 +182,21 @@ describe('TUI', function() ]]) end) + it('handles pasting a specific amount of text', function() + -- Need extra time for this test, specially in ASAN. + screen.timeout = 60000 + feed_data('i\027[200~'..string.rep('z', 64)..'\027[201~') + screen:expect([[ + zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz| + zzzzzzzzzzzzzz{1: } | + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]) + end) + it('can handle arbitrarily long bursts of input', function() -- Need extra time for this test, specially in ASAN. screen.timeout = 60000 |