]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0566: <C-w>f duplicates window if do_ecmd() is aborted v9.2.0566
authorYohei Kojima <yk@y-koj.net>
Sat, 30 May 2026 18:07:21 +0000 (18:07 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 30 May 2026 18:07:21 +0000 (18:07 +0000)
commit113e507cdd7be13607db81dcd6cd09aaedf93540
tree0648328941cc0c3a09b098e01e6c7dc7961ab262
parent63680c6d3d52477817b49cd1a66e7aabe8a7aa19
patch 9.2.0566: <C-w>f duplicates window if do_ecmd() is aborted

Problem:  If got_int is true when win_close() is called, it unexpectedly
          fails in the branch that detects failure in apply_autocmds().
          This causes wingotofile in do_window() to duplicate current
          window when do_ecmd() is aborted with got_int.
Solution: Fix do_window() to save the got_int value before trying to
          close the split window (Yohei Kojima).

Steps to reproduce:
 1. run `touch a && touch .a.swp && echo a > b && vim b`
 2. Type `<C-w>f`
 3. In the warning dialogue, type `a` to abort
 4. Current window is duplicated

closes: #20382

Signed-off-by: Yohei Kojima <yk@y-koj.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_window_cmd.vim
src/version.c
src/window.c