From e3d4dfb6c3fcd22205f6843b96f9a043871113ce Mon Sep 17 00:00:00 2001 From: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Sun, 25 Feb 2024 01:22:55 +0000 Subject: vim-patch:9.1.0128: win_gotoid() may abort even when not switching a window Problem: win_gotoid() checks for textlock and other things when switching to a window that is already current (after v9.1.0119) Solution: return early with success when attempting to switch to curwin (Sean Dewar) https://github.com/vim/vim/commit/2a65e739447949a7aee966ce8a3b75521b2a79ea --- test/old/testdir/test_window_cmd.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim index 02fa3ac407..7ea556b11f 100644 --- a/test/old/testdir/test_window_cmd.vim +++ b/test/old/testdir/test_window_cmd.vim @@ -2173,6 +2173,10 @@ func Test_win_gotoid_splitmove_textlock_cmdwin() set debug+=throw indentexpr=win_gotoid(win_getid(winnr('#'))) call assert_fails('normal! ==', 'E565:') call assert_equal(curwin, win_getid()) + " No error if attempting to switch to curwin; nothing happens. + set indentexpr=assert_equal(1,win_gotoid(win_getid())) + normal! == + call assert_equal(curwin, win_getid()) set indentexpr=win_splitmove(winnr('#'),winnr()) call assert_fails('normal! ==', 'E565:') @@ -2188,6 +2192,8 @@ func Test_win_gotoid_splitmove_textlock_cmdwin() call feedkeys('q:' \ .. ":call assert_fails('call win_gotoid(win_getid(winnr(''#'')))', 'E11:')\" + "\ No error if attempting to switch to curwin; nothing happens. + \ .. ":call assert_equal(1, win_gotoid(win_getid()))\" \ .. ":call assert_equal('command', win_gettype())\" \ .. ":call assert_equal('', win_gettype(winnr('#')))\", 'ntx') endfunc -- cgit