diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-07-19 11:54:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-19 03:54:42 +0000 |
commit | 35b35cb93cb54d2a9b7f881b930ba42186e57d23 (patch) | |
tree | 13e30c46ed8d9621bf5f0118f0f0952d42943fee /test/old/testdir | |
parent | 0b710c8e55930a082e030f980f84bd1e71a29592 (diff) | |
download | rneovim-35b35cb93cb54d2a9b7f881b930ba42186e57d23.tar.gz rneovim-35b35cb93cb54d2a9b7f881b930ba42186e57d23.tar.bz2 rneovim-35b35cb93cb54d2a9b7f881b930ba42186e57d23.zip |
vim-patch:9.1.0601: Wrong cursor position with 'breakindent' when wide char doesn't fit (#29793)
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: vim/vim#15289
closes: vim/vim#15290
https://github.com/vim/vim/commit/b5d6b5caac752fe15856e37fd3abc5459292d4b8
Diffstat (limited to 'test/old/testdir')
-rw-r--r-- | test/old/testdir/test_breakindent.vim | 11 | ||||
-rw-r--r-- | test/old/testdir/test_listlbr_utf8.vim | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/old/testdir/test_breakindent.vim b/test/old/testdir/test_breakindent.vim index 636ec6f285..f09ab8684f 100644 --- a/test/old/testdir/test_breakindent.vim +++ b/test/old/testdir/test_breakindent.vim @@ -1205,4 +1205,15 @@ func Test_breakindent_min_with_signcol() 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 diff --git a/test/old/testdir/test_listlbr_utf8.vim b/test/old/testdir/test_listlbr_utf8.vim index 313ff30cc4..693f2015fc 100644 --- a/test/old/testdir/test_listlbr_utf8.vim +++ b/test/old/testdir/test_listlbr_utf8.vim @@ -280,6 +280,9 @@ func Test_chinese_char_on_wrap_column() call s:compare_lines(expect, lines) call assert_equal(len(expect), winline()) call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol()) + norm! g0 + call assert_equal(len(expect), winline()) + call assert_equal(1, wincol()) call s:close_windows() endfunc @@ -315,6 +318,9 @@ func Test_chinese_char_on_wrap_column_sbr() call s:compare_lines(expect, lines) call assert_equal(len(expect), winline()) call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol()) + norm! g0 + call assert_equal(len(expect), winline()) + call assert_equal(4, wincol()) call s:close_windows() endfunc |