Files
neovim/test/functional/legacy/global_spec.lua
Justin M. Keyes fbcb7a056c feat(exmode): "1q:", :exmode #41010
Problem:
Want `gQ` for _le multicursor_.

Solution:
- Don't use `gQ` for exmode.
- Introduce `:exmode`.
- Introduce `[count]q:` as an alias to `:exmode`.
2026-07-27 11:12:47 -04:00

47 lines
1.7 KiB
Lua

local n = require('test.functional.testnvim')()
local t = require('test.testutil')
local Screen = require('test.functional.ui.screen')
local describe, it, before_each = t.describe, t.it, t.before_each
local clear = n.clear
local exec = n.exec
local feed = n.feed
local poke_eventloop = n.poke_eventloop
before_each(clear)
describe(':global', function()
-- oldtest: Test_interrupt_global()
it('can be interrupted using Ctrl-C in cmdline mode vim-patch:9.0.0082', function()
local screen = Screen.new(75, 6)
exec([[
set nohlsearch noincsearch
cnoremap ; <Cmd>sleep 10<CR>
call setline(1, repeat(['foo'], 5))
]])
feed(':g/foo/norm :<C-V>;<CR>')
poke_eventloop() -- Wait for :sleep to start
feed('<C-C>')
screen:expect([[
^foo |
foo |*4
{9:Interrupted} |
]])
-- Also test in Ex mode (keep-open cmdwin REPL)
feed('1q:g/foo/norm :<C-V>;<CR>')
poke_eventloop() -- Wait for :sleep to start
feed('<C-C>')
screen:expect([[
foo |
{2:[No Name] [+] }|
{1::}" Keyboard interrupt |
{1::}^ |
{3:[Ex mode] }|
{5:-- INSERT --} |
]])
end)
end)