aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-02-25 00:43:06 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-03-01 20:02:10 -0500
commitb376bb49b5a1f71b05389857f324bc6820ede747 (patch)
tree1f45ae705d8b3155247e44a86d4262c5b62707e2 /src/nvim/testdir
parentc6481f70c22899604b7707299bb96d0f0768334f (diff)
downloadrneovim-b376bb49b5a1f71b05389857f324bc6820ede747.tar.gz
rneovim-b376bb49b5a1f71b05389857f324bc6820ede747.tar.bz2
rneovim-b376bb49b5a1f71b05389857f324bc6820ede747.zip
vim-patch:8.1.1552: cursor position is wrong after sign column changes
Problem: Cursor position is wrong after sign column appears or disappears. (Yegappan Lakshmanan) Solution: Call changed_line_abv_curs() instead of changed_cline_bef_curs(). https://github.com/vim/vim/commit/f85e40afc204c241c6a01023be3e7b8101d36367
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_signs.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim
index 6af81e15c5..dcbb546a2e 100644
--- a/src/nvim/testdir/test_signs.vim
+++ b/src/nvim/testdir/test_signs.vim
@@ -4,6 +4,8 @@ if !has('signs')
finish
endif
+source screendump.vim
+
func Test_sign()
new
call setline(1, ['a', 'b', 'c', 'd'])
@@ -1652,3 +1654,31 @@ func Test_sign_jump_func()
sign undefine sign1
enew! | only!
endfunc
+
+" Test for correct cursor position after the sign column appears or disappears.
+func Test_sign_cursor_position()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+
+ let lines =<< trim END
+ call setline(1, [repeat('x', 75), 'mmmm', 'yyyy'])
+ call cursor(2,1)
+ sign define s1 texthl=Search text==>
+ redraw
+ sign place 10 line=2 name=s1
+ END
+ call writefile(lines, 'XtestSigncolumn')
+ let buf = RunVimInTerminal('-S XtestSigncolumn', {'rows': 6})
+ call VerifyScreenDump(buf, 'Test_sign_cursor_01', {})
+
+ " update cursor position calculation
+ call term_sendkeys(buf, "lh")
+ call term_sendkeys(buf, ":sign unplace 10\<CR>")
+ call VerifyScreenDump(buf, 'Test_sign_cursor_02', {})
+
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestSigncolumn')
+endfunc