diff src/testdir/test_breakindent.vim @ 27952:22cdc06b37bf v8.2.4501

patch 8.2.4501: with 'showbreak' set cursor displayed in wrong position Commit: https://github.com/vim/vim/commit/21efafe4c25373929979c72dc8aafa119f12dd8b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 3 20:04:03 2022 +0000 patch 8.2.4501: with 'showbreak' set cursor displayed in wrong position 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)
author Bram Moolenaar <Bram@vim.org>
date Thu, 03 Mar 2022 21:15:04 +0100
parents d2471d710ec9
children b4c111ea83b1
line wrap: on
line diff
--- 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')