mirror of
https://github.com/neovim/neovim.git
synced 2025-10-22 17:11:49 +00:00
tests: win: enable buffer focus test
This commit is contained in:
@@ -158,14 +158,15 @@ describe(':terminal buffer', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('handles loss of focus gracefully', function()
|
it('handles loss of focus gracefully', function()
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
-- Change the statusline to avoid printing the file name, which varies.
|
-- Change the statusline to avoid printing the file name, which varies.
|
||||||
nvim('set_option', 'statusline', '==========')
|
nvim('set_option', 'statusline', '==========')
|
||||||
feed_command('set laststatus=0')
|
feed_command('set laststatus=0')
|
||||||
|
|
||||||
-- Save the buffer number of the terminal for later testing.
|
-- Save the buffer number of the terminal for later testing.
|
||||||
local tbuf = eval('bufnr("%")')
|
local tbuf = eval('bufnr("%")')
|
||||||
|
local exitcmd = helpers.iswin()
|
||||||
|
and "['cmd', '/c', 'exit']"
|
||||||
|
or "['sh', '-c', 'exit']"
|
||||||
source([[
|
source([[
|
||||||
function! SplitWindow(id, data, event)
|
function! SplitWindow(id, data, event)
|
||||||
new
|
new
|
||||||
@@ -173,7 +174,7 @@ describe(':terminal buffer', function()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
startinsert
|
startinsert
|
||||||
call jobstart(['sh', '-c', 'exit'], {'on_exit': function("SplitWindow")})
|
call jobstart(]]..exitcmd..[[, {'on_exit': function("SplitWindow")})
|
||||||
call feedkeys("\<C-\>", 't') " vim will expect <C-n>, but be exited out of
|
call feedkeys("\<C-\>", 't') " vim will expect <C-n>, but be exited out of
|
||||||
" the terminal before it can be entered.
|
" the terminal before it can be entered.
|
||||||
]])
|
]])
|
||||||
|
Reference in New Issue
Block a user