mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix: set RedrawingDisabled before entering aucmd_win
This commit is contained in:
parent
1b6ae2dbb0
commit
dd21e21e97
@ -1160,7 +1160,10 @@ void aucmd_prepbuf(aco_save_T *aco, buf_T *buf)
|
|||||||
// Prevent chdir() call in win_enter_ext(), through do_autochdir()
|
// Prevent chdir() call in win_enter_ext(), through do_autochdir()
|
||||||
int save_acd = p_acd;
|
int save_acd = p_acd;
|
||||||
p_acd = false;
|
p_acd = false;
|
||||||
|
// no redrawing and don't set the window title
|
||||||
|
RedrawingDisabled++;
|
||||||
win_enter(aucmd_win, false);
|
win_enter(aucmd_win, false);
|
||||||
|
RedrawingDisabled--;
|
||||||
p_acd = save_acd;
|
p_acd = save_acd;
|
||||||
unblock_autocmds();
|
unblock_autocmds();
|
||||||
curwin = aucmd_win;
|
curwin = aucmd_win;
|
||||||
|
@ -6,6 +6,7 @@ local insert = helpers.insert
|
|||||||
local eq = helpers.eq
|
local eq = helpers.eq
|
||||||
local eval = helpers.eval
|
local eval = helpers.eval
|
||||||
local iswin = helpers.iswin
|
local iswin = helpers.iswin
|
||||||
|
local funcs, meths, exec_lua = helpers.funcs, helpers.meths, helpers.exec_lua
|
||||||
|
|
||||||
describe('screen', function()
|
describe('screen', function()
|
||||||
local screen
|
local screen
|
||||||
@ -127,14 +128,67 @@ local function screen_tests(linegrid)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('has correct default title with named file', function()
|
it('has correct default title with named file', function()
|
||||||
local expected = (iswin() and 'myfile (C:\\mydir) - NVIM'
|
local expected = (iswin() and 'myfile (C:\\mydir) - NVIM' or 'myfile (/mydir) - NVIM')
|
||||||
or 'myfile (/mydir) - NVIM')
|
|
||||||
command('set title')
|
command('set title')
|
||||||
command(iswin() and 'file C:\\mydir\\myfile' or 'file /mydir/myfile')
|
command(iswin() and 'file C:\\mydir\\myfile' or 'file /mydir/myfile')
|
||||||
screen:expect(function()
|
screen:expect(function()
|
||||||
eq(expected, screen.title)
|
eq(expected, screen.title)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
describe('is not changed by', function()
|
||||||
|
local file1 = iswin() and 'C:\\mydir\\myfile1' or '/mydir/myfile1'
|
||||||
|
local file2 = iswin() and 'C:\\mydir\\myfile2' or '/mydir/myfile2'
|
||||||
|
local expected = (iswin() and 'myfile1 (C:\\mydir) - NVIM' or 'myfile1 (/mydir) - NVIM')
|
||||||
|
local buf2
|
||||||
|
|
||||||
|
before_each(function()
|
||||||
|
command('edit '..file1)
|
||||||
|
buf2 = funcs.bufadd(file2)
|
||||||
|
command('set title')
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('calling setbufvar() to set an option in a hidden buffer from i_CTRL-R', function()
|
||||||
|
command([[inoremap <F2> <C-R>=setbufvar(]]..buf2..[[, '&autoindent', 1) ? '' : ''<CR>]])
|
||||||
|
feed('i<F2><Esc>')
|
||||||
|
command('redraw!')
|
||||||
|
screen:expect(function()
|
||||||
|
eq(expected, screen.title)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('an RPC call to nvim_buf_set_option in a hidden buffer', function()
|
||||||
|
meths.buf_set_option(buf2, 'autoindent', true)
|
||||||
|
command('redraw!')
|
||||||
|
screen:expect(function()
|
||||||
|
eq(expected, screen.title)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('a Lua callback calling nvim_buf_set_option in a hidden buffer', function()
|
||||||
|
exec_lua(string.format([[
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.api.nvim_buf_set_option(%d, 'autoindent', true)
|
||||||
|
end)
|
||||||
|
]], buf2))
|
||||||
|
command('redraw!')
|
||||||
|
screen:expect(function()
|
||||||
|
eq(expected, screen.title)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('a Lua callback calling nvim_buf_call in a hidden buffer', function()
|
||||||
|
exec_lua(string.format([[
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.api.nvim_buf_call(%d, function() end)
|
||||||
|
end)
|
||||||
|
]], buf2))
|
||||||
|
command('redraw!')
|
||||||
|
screen:expect(function()
|
||||||
|
eq(expected, screen.title)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe(':set icon', function()
|
describe(':set icon', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user