summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_breakindent.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-03 20:04:03 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-03 20:04:03 +0000
commit21efafe4c25373929979c72dc8aafa119f12dd8b (patch)
treef3fabbfba3e339c35a2567d2c61f1560793d491b /src/testdir/test_breakindent.vim
parent0e1574c4069ded47c170fcd7a47a0df66693a5f4 (diff)
patch 8.2.4501: with 'showbreak' set cursor displayed in wrong positionv8.2.4501
Problem: With 'showbreak' set and after the end of the line the cursor may be displayed in the wrong position. Solution: Do not apply 'showbreak' after the end of the line. (closes #9884)
Diffstat (limited to 'src/testdir/test_breakindent.vim')
-rw-r--r--src/testdir/test_breakindent.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_breakindent.vim b/src/testdir/test_breakindent.vim
index 6258a7ac5f..d60b2f4a19 100644
--- a/src/testdir/test_breakindent.vim
+++ b/src/testdir/test_breakindent.vim
@@ -8,6 +8,7 @@ source check.vim
CheckOption breakindent
source view_util.vim
+source screendump.vim
let s:input ="\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP"
@@ -849,6 +850,27 @@ func Test_window_resize_with_linebreak()
%bw!
endfunc
+func Test_cursor_position_with_showbreak()
+ CheckScreendump
+
+ let lines =<< trim END
+ vim9script
+ &signcolumn = 'yes'
+ &showbreak = '+ '
+ var leftcol: number = win_getid()->getwininfo()->get(0, {})->get('textoff')
+ repeat('x', &columns - leftcol - 1)->setline(1)
+ 'second line'->setline(2)
+ END
+ call writefile(lines, 'XscriptShowbreak')
+ let buf = RunVimInTerminal('-S XscriptShowbreak', #{rows: 6})
+
+ call term_sendkeys(buf, "AX")
+ call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XscriptShowbreak')
+endfunc
+
func Test_no_spurious_match()
let s:input = printf('- y %s y %s', repeat('x', 50), repeat('x', 50))
call s:test_windows('setl breakindent breakindentopt=list:-1 formatlistpat=^- hls')