mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 10:26:42 +10:00
vim-patch:9.1.2001: cursor may end up in wrong window after :botright copen (#37056)
Problem: After :botright copen and closing the quikfix window, the
cursor ends up in the wrong window. The problem is fr_child
always points to the first (leftmost for FR_ROW, topmost for
FR_COL) child frame. When do :vsplit, the new window is
created on the left, and frame_insert() updates the parent's
fr_child to point to this new left window.
Solution: Create a snapshot before open the quickfix window and restore
it when close it (glepnir).
closes: vim/vim#18961
b43f9ded7e
Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
@@ -6980,4 +6980,15 @@ func Test_vimgrep_dummy_buffer_keep()
|
||||
%bw!
|
||||
endfunc
|
||||
|
||||
func Test_quickfix_restore_current_win()
|
||||
let curwin = win_getid()
|
||||
vsplit Xb
|
||||
wincmd p
|
||||
botright copen
|
||||
cclose
|
||||
|
||||
call assert_equal(curwin, win_getid())
|
||||
bw! Xb
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user