test(old): map gQ to 1q: (#41025)

This commit is contained in:
zeertzjq
2026-07-28 18:11:42 +08:00
committed by GitHub
parent 5745ea93f1
commit 205a1ce4c7
3 changed files with 9 additions and 7 deletions

View File

@@ -36,9 +36,11 @@ if exists('s:did_load')
set isfname+=:
endif
if g:testname !~ 'test_mapping\.vim$'
" Make "Q" switch to Ex mode.
" Make "Q" behave like normal Ex mode.
" This does not work for all tests as Nvim only supports Vim Ex mode.
nnoremap Q 1q:<Cmd>call<SID>ExStart()<CR>
" Make "gQ" go to Vim Ex mode.
noremap gQ 1q:
endif
endif

View File

@@ -2606,7 +2606,7 @@ func Test_cmdwin_ex_mode_with_modifier()
" this was accessing memory after allocated text in Ex mode
new
call setline(1, ['some', 'text', 'lines'])
silent! call feedkeys("1q:normal vq:atopleft\<C-V>\<CR>\<CR>", 'xt')
silent! call feedkeys("gQnormal vq:atopleft\<C-V>\<CR>\<CR>", 'xt')
bwipe!
endfunc

View File

@@ -71,7 +71,7 @@ func Test_Ex_substitute()
call term_sendkeys(buf, ":call setline(1, repeat(['foo foo'], 4))\<CR>")
call term_sendkeys(buf, ":set number\<CR>")
call term_sendkeys(buf, "1q:")
call term_sendkeys(buf, "gQ")
call WaitForAssert({-> assert_match(':', term_getline(buf, 6))}, 1000)
call term_sendkeys(buf, "%s/foo/bar/gc\<CR>")
@@ -217,7 +217,7 @@ func Test_Ex_append_in_loop()
CheckRunVimInTerminal
let buf = RunVimInTerminal('', {'rows': 6})
call term_sendkeys(buf, "1q:")
call term_sendkeys(buf, "gQ")
call term_sendkeys(buf, "for i in range(1)\<CR>")
call term_sendkeys(buf, "append\<CR>")
call WaitForAssert({-> assert_match(': append', term_getline(buf, 5))}, 1000)
@@ -275,13 +275,13 @@ func Test_ex_mode_errors()
func ExEnterFunc()
endfunc
call feedkeys("1q:vi\r", 'xt')
call feedkeys("gQvi\r", 'xt')
au! CmdLineEnter
delfunc ExEnterFunc
au CmdlineEnter * :
call feedkeys("1q:echo 1\r", 'xt')
call feedkeys("gQecho 1\r", 'xt')
au! CmdlineEnter
@@ -337,7 +337,7 @@ func Test_ex_mode_large_indent()
new
set ts=500 ai
call setline(1, "\t")
exe "normal 1q:i\<CR>."
exe "normal gQi\<CR>."
set ts=8 noai
bwipe!
endfunc