aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-23 08:18:42 +0800
committerGitHub <noreply@github.com>2024-04-23 08:18:42 +0800
commitd0ab67410c04b1f79b774ed73a912ceae87952f8 (patch)
tree08cdfc3a4598e333d3aa8b6a9831179106eff71c /test
parentcb2b5e2780a6de8a3f3cad84cad7318535571a68 (diff)
downloadrneovim-d0ab67410c04b1f79b774ed73a912ceae87952f8.tar.gz
rneovim-d0ab67410c04b1f79b774ed73a912ceae87952f8.tar.bz2
rneovim-d0ab67410c04b1f79b774ed73a912ceae87952f8.zip
vim-patch:9.1.0365: Crash when typing many keys with D- modifier (#28464)
Problem: Crash when typing many keys with D- modifier (after 9.1.0227). Solution: Don't treat a 0x80 byte inside a special sequence as the start of a special sequence (zeertzjq). closes: vim/vim#14613 https://github.com/vim/vim/commit/6b13e3d4e46393b3a35eed7c27ae020bcbd46a9b
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_mapping.vim24
-rw-r--r--test/old/testdir/test_registers.vim13
2 files changed, 27 insertions, 10 deletions
diff --git a/test/old/testdir/test_mapping.vim b/test/old/testdir/test_mapping.vim
index 7b73e9d013..2a4d068dea 100644
--- a/test/old/testdir/test_mapping.vim
+++ b/test/old/testdir/test_mapping.vim
@@ -236,21 +236,25 @@ func Test_map_meta_multibyte()
endfunc
func Test_map_super_quotes()
- if has('gui_gtk') || has('gui_gtk3') || has("macos")
- imap <D-"> foo
- call feedkeys("Go-\<*D-\">-\<Esc>", "xt")
- call assert_equal("-foo-", getline('$'))
- set nomodified
- iunmap <D-">
+ if "\<D-j>"[-1:] == '>'
+ throw 'Skipped: <D- modifier not supported'
endif
+
+ imap <D-"> foo
+ call feedkeys("Go-\<*D-\">-\<Esc>", "xt")
+ call assert_equal("-foo-", getline('$'))
+ set nomodified
+ iunmap <D-">
endfunc
func Test_map_super_multibyte()
- if has('gui_gtk') || has('gui_gtk3') || has("macos")
- imap <D-á> foo
- call assert_match('i <D-á>\s*foo', execute('imap'))
- iunmap <D-á>
+ if "\<D-j>"[-1:] == '>'
+ throw 'Skipped: <D- modifier not supported'
endif
+
+ imap <D-á> foo
+ call assert_match('i <D-á>\s*foo', execute('imap'))
+ iunmap <D-á>
endfunc
func Test_abbr_after_line_join()
diff --git a/test/old/testdir/test_registers.vim b/test/old/testdir/test_registers.vim
index 8ca7fe31c3..e5add9414f 100644
--- a/test/old/testdir/test_registers.vim
+++ b/test/old/testdir/test_registers.vim
@@ -266,6 +266,19 @@ func Test_zz_recording_with_select_mode_utf8_gui()
call Run_test_recording_with_select_mode_utf8()
endfunc
+func Test_recording_with_super_mod()
+ if "\<D-j>"[-1:] == '>'
+ throw 'Skipped: <D- modifier not supported'
+ endif
+
+ nnoremap <D-j> <Ignore>
+ let s = repeat("\<D-j>", 1000)
+ " This used to crash Vim
+ call feedkeys($'qr{s}q', 'tx')
+ call assert_equal(s, @r)
+ nunmap <D-j>
+endfunc
+
" Test for executing the last used register (@)
func Test_last_used_exec_reg()
" Test for the @: command