summaryrefslogtreecommitdiff
path: root/src/testdir/test_signs.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-16 13:55:40 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-16 13:55:40 +0200
commitf85e40afc204c241c6a01023be3e7b8101d36367 (patch)
tree15c6e38573537bc8fc12e9733f126b69a0c65e7d /src/testdir/test_signs.vim
parent6c17543b5634ccccedfbffa4993e9fbd4a990067 (diff)
downloadvim-git-f85e40afc204c241c6a01023be3e7b8101d36367.tar.gz
patch 8.1.1552: cursor position is wrong after sign column changesv8.1.1552
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().
Diffstat (limited to 'src/testdir/test_signs.vim')
-rw-r--r--src/testdir/test_signs.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/testdir/test_signs.vim b/src/testdir/test_signs.vim
index 3b17eccf0..140aa8234 100644
--- a/src/testdir/test_signs.vim
+++ b/src/testdir/test_signs.vim
@@ -3,6 +3,8 @@
source check.vim
CheckFeature signs
+source screendump.vim
+
func Test_sign()
new
call setline(1, ['a', 'b', 'c', 'd'])
@@ -1706,3 +1708,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