From 27fd4f31fda297b5996cf79eaaf5e8617eab777c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 14 Sep 2019 12:30:31 -0400 Subject: vim-patch:8.1.0289: cursor moves to wrong column after quickfix jump Problem: Cursor moves to wrong column after quickfix jump. Solution: Set the curswant flag. (Andy Massimino, closes vim/vim#3331) https://github.com/vim/vim/commit/2dfcef4c08a3371e2126504bea00b274f937a840 --- src/nvim/quickfix.c | 1 + src/nvim/testdir/test_quickfix.vim | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 6c26e53cd7..301f72fa79 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2299,6 +2299,7 @@ static void qf_jump_goto_line(linenr_T qf_lnum, int qf_col, char_u qf_viscol, } } } + curwin->w_set_curswant = true; check_cursor(); } else { beginline(BL_WHITE | BL_FIX); diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 16f008ca41..b7f45aeeb1 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -3566,3 +3566,12 @@ func Test_view_result_split() call Xview_result_split_tests('c') call Xview_result_split_tests('l') endfunc + +" Test that :cc sets curswant +func Test_curswant() + helpgrep quickfix + normal! llll + 1cc + call assert_equal(getcurpos()[4], virtcol('.')) + cclose | helpclose +endfunc -- cgit