diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-07-14 06:38:26 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2024-07-14 13:39:40 +0800 |
| commit | 9093fbdd026f088d923fea374a96a8b01ca0df3a (patch) | |
| tree | c7499162182654955099ca94e39b23a446f56f05 /test/old/testdir/setup.vim | |
| parent | 49ba36becd0bbf1052802b846f418aee673b28a5 (diff) | |
| download | rneovim-9093fbdd026f088d923fea374a96a8b01ca0df3a.tar.gz rneovim-9093fbdd026f088d923fea374a96a8b01ca0df3a.tar.bz2 rneovim-9093fbdd026f088d923fea374a96a8b01ca0df3a.zip | |
vim-patch:9.1.0573: ex: no implicit print for single addresses
Problem: ex: no implicit print for single addresses
Solution: explicitly print even during single addresses,
as requested by POSIX (Mohamed Akram)
See the POSIX behaviour here:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html#tag_20_40_13_03
Section 6b
closes: vim/vim#15230
https://github.com/vim/vim/commit/c25a7084e9ae1f78c28ddcbe1fa23374cfdf1e03
Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
Diffstat (limited to 'test/old/testdir/setup.vim')
| -rw-r--r-- | test/old/testdir/setup.vim | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim index 2e4085ce03..6f400c5e32 100644 --- a/test/old/testdir/setup.vim +++ b/test/old/testdir/setup.vim @@ -32,8 +32,8 @@ if exists('s:did_load') endif if g:testname !~ 'test_mapping.vim$' " Make "Q" switch to Ex mode. - " This does not work for all tests. - nnoremap Q gQ + " This does not work for all tests as Nvim only supports Vim Ex mode. + nnoremap Q gQ<Cmd>call<SID>ExStart()<CR> endif endif @@ -45,6 +45,21 @@ if exists('s:did_load') endif let s:did_load = 1 +func s:ExStart() + call feedkeys($"\<Cmd>call{expand('<SID>')}ExMayEnd()\<CR>") +endfunc + +func s:ExMayEnd() + " When :normal runs out of characters in Vim, the behavior is different in + " normal Ex mode vs. Vim Ex mode. + " - In normal Ex mode, "\n" is used. + " - In Vim Ex mode, Ctrl-C is used. + " Nvim only supports Vim Ex mode, so emulate the normal Ex mode behavior. + if state('m') == '' && mode(1) == 'cv' && getcharstr(1) == "\<C-C>" + call feedkeys("\n") + endif +endfunc + " Clear Nvim default user commands, mappings and menus. comclear mapclear |