aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-09-14 12:30:31 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-09-14 12:31:47 -0400
commit27fd4f31fda297b5996cf79eaaf5e8617eab777c (patch)
treebf7dc1ec1da30ca5618efe88ba0443462596ec08
parent8c88d98df955ebf2fb93506c19ce2af82e24a2df (diff)
downloadrneovim-27fd4f31fda297b5996cf79eaaf5e8617eab777c.tar.gz
rneovim-27fd4f31fda297b5996cf79eaaf5e8617eab777c.tar.bz2
rneovim-27fd4f31fda297b5996cf79eaaf5e8617eab777c.zip
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
-rw-r--r--src/nvim/quickfix.c1
-rw-r--r--src/nvim/testdir/test_quickfix.vim9
2 files changed, 10 insertions, 0 deletions
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