mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 06:46:07 +00:00
fix(difftool): ensure split layout, use systemlist #36145
- Always open the right window to the right, regardless of 'splitright' setting, ensuring the left window is always leftmost. - Use `vim.fn.systemlist` for diffr output to avoid manual splitting. - Add a test to verify window layout consistency with 'splitright' and 'nosplitright' options. - Escape quotes in git difftool example properly. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -49,6 +49,18 @@ describe('nvim.difftool', function()
|
||||
}, entries)
|
||||
end)
|
||||
|
||||
it('has consistent split layout', function()
|
||||
command('set nosplitright')
|
||||
command(('DiffTool %s %s'):format(testdir_left, testdir_right))
|
||||
local wins = fn.getwininfo()
|
||||
local left_win_col = wins[1].wincol
|
||||
local right_win_col = wins[2].wincol
|
||||
assert(
|
||||
left_win_col < right_win_col,
|
||||
'Left window should be to the left of right window even with nosplitright set'
|
||||
)
|
||||
end)
|
||||
|
||||
it('has autocmds when diff window is opened', function()
|
||||
command(('DiffTool %s %s'):format(testdir_left, testdir_right))
|
||||
local autocmds = fn.nvim_get_autocmds({ group = 'nvim.difftool.events' })
|
||||
|
Reference in New Issue
Block a user