Problem:
After botright copen and close this quikfix window, 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:
Same as help windows - snapshot before open, restore when close.
https://github.com/vim/vim/pull/18961
(5 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@h-east commented on this pull request.
In src/window.c:
> @@ -2740,6 +2746,11 @@ win_close(win_T *win, int free_buf)
else
clear_snapshot(curtab, SNAP_HELP_IDX);
+ if (bt_quickfix(win->w_buffer))
+ quickfix_window = true;
TRUE/FALSE for int type. true/false for bool type.
⬇️ Suggested change- quickfix_window = true; + quickfix_window = TRUE;
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@yegappan commented on this pull request.
In src/testdir/test_quickfix.vim:
> @@ -6958,4 +6958,16 @@ func Test_vimgrep_dummy_buffer_keep() %bw! endfunc +func Test_quickfix_restore_current_win() + let curwin = win_getid() + vsplit b + wincmd p + botright copen + cclose + + call assert_true(curwin == win_getid())
Can you use call assert_equal(curwin, win_getid()) instead? When a test fails, assert_equal() will emit the expected value and the actual value but assert_true() will not do that. This is useful in debugging tests that are failing.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
> @@ -6958,4 +6958,16 @@ func Test_vimgrep_dummy_buffer_keep() %bw! endfunc +func Test_quickfix_restore_current_win() + let curwin = win_getid() + vsplit b + wincmd p + botright copen + cclose + + call assert_true(curwin == win_getid()) + wincmd w
Is jumping to another window needed here?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@glepnir pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@zeertzjq commented on this pull request.
In src/testdir/test_quickfix.vim:
> @@ -6958,4 +6958,15 @@ func Test_vimgrep_dummy_buffer_keep() %bw! endfunc +func Test_quickfix_restore_current_win() + let curwin = win_getid() + vsplit b + wincmd p + botright copen + cclose + + call assert_equal(1, curwin == win_getid())⬇️ Suggested change
- call assert_equal(1, curwin == win_getid()) + call assert_equal(curwin, win_getid())
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@zeertzjq commented on this pull request.
In src/testdir/test_quickfix.vim:
> @@ -6958,4 +6958,15 @@ func Test_vimgrep_dummy_buffer_keep() %bw! endfunc +func Test_quickfix_restore_current_win() + let curwin = win_getid() + vsplit b
Having a single-character buffer name is a bit strange.
⬇️ Suggested change- vsplit b + vsplit Xb
In src/testdir/test_quickfix.vim:
> @@ -6958,4 +6958,15 @@ func Test_vimgrep_dummy_buffer_keep() %bw! endfunc +func Test_quickfix_restore_current_win() + let curwin = win_getid() + vsplit b + wincmd p + botright copen + cclose + + call assert_equal(curwin, win_getid()) + only⬇️ Suggested change
- only + bw! Xb
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@glepnir commented on this pull request.
In src/testdir/test_quickfix.vim:
> @@ -6958,4 +6958,15 @@ func Test_vimgrep_dummy_buffer_keep() %bw! endfunc +func Test_quickfix_restore_current_win() + let curwin = win_getid() + vsplit b
okay
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()