patch 9.1.0601: Wrong cursor position with 'breakindent' when wide char doesn't fit
Problem: Wrong cursor position with 'breakindent' when a double-width
character doesn't fit in a screen line (mikoto2000)
Solution: Include the width of the 'breakindent' properly.
(zeertzjq)
fixes: #15289
closes: #15290
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_breakindent.vim b/src/testdir/test_breakindent.vim
index 96d91c9..b306c02 100644
--- a/src/testdir/test_breakindent.vim
+++ b/src/testdir/test_breakindent.vim
@@ -1165,4 +1165,15 @@
call s:close_windows()
endfunc
+func Test_breakindent_with_double_width_wrap()
+ 50vnew
+ setlocal tabstop=8 breakindent nolist
+ call setline(1, "\t" .. repeat('a', winwidth(0) - 9) .. '口口口')
+ normal! $g0
+ call assert_equal(2, winline())
+ call assert_equal(9, wincol())
+
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab