diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-02-12 06:34:16 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-12 06:34:16 +0800 |
| commit | 9605cfe06c44df032231360fb0fcd07e3f4ae10a (patch) | |
| tree | 88e456903fa524bdde4efaf5c25cab6db6696f2a /test | |
| parent | 3faedb0509545a01d84a37bdadf4a9150cc03d5c (diff) | |
| download | rneovim-9605cfe06c44df032231360fb0fcd07e3f4ae10a.tar.gz rneovim-9605cfe06c44df032231360fb0fcd07e3f4ae10a.tar.bz2 rneovim-9605cfe06c44df032231360fb0fcd07e3f4ae10a.zip | |
vim-patch:9.1.0097: 'breakindent' behaves inconsistently with 'list' and splits (#27432)
Problem: 'breakindent' behaves inconsistently with 'list' and splits.
Solution: Use 'listchars' from the correct window and handle caching
properly. Move cheaper comparisons to the top.
(zeertzjq)
closes: vim/vim#14008
https://github.com/vim/vim/commit/efabd7c8d4f733350364356b8950a11f013aec49
Diffstat (limited to 'test')
| -rw-r--r-- | test/old/testdir/test_breakindent.vim | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/test/old/testdir/test_breakindent.vim b/test/old/testdir/test_breakindent.vim index 426f8ab278..3141cb9e8b 100644 --- a/test/old/testdir/test_breakindent.vim +++ b/test/old/testdir/test_breakindent.vim @@ -450,7 +450,7 @@ func Test_breakindent12() \ "~ ", \ ] call s:compare_lines(expect, lines) - call s:close_windows('set nuw=4 listchars=') + call s:close_windows('set nuw=4 listchars&') endfunc func Test_breakindent12_vartabs() @@ -467,7 +467,7 @@ func Test_breakindent12_vartabs() \ "~ ", \ ] call s:compare_lines(expect, lines) - call s:close_windows('set nuw=4 listchars= vts&') + call s:close_windows('set nuw=4 listchars& vts&') endfunc func Test_breakindent13() @@ -1126,5 +1126,51 @@ func Test_linebreak_list() bwipe! endfunc +func Test_breakindent_change_display_uhex() + call s:test_windows('setl briopt=min:0 list listchars=eol:$') + redraw! + let lines = s:screen_lines(line('.'), 20) + let expect = [ + \ "^Iabcdefghijklmnopqr", + \ " stuvwxyzABCDEFGHIJ", + \ " KLMNOP$ " + \ ] + call s:compare_lines(expect, lines) + set display+=uhex + redraw! + let lines = s:screen_lines(line('.'), 20) + let expect = [ + \ "<09>abcdefghijklmnop", + \ " qrstuvwxyzABCDEF", + \ " GHIJKLMNOP$ " + \ ] + call s:compare_lines(expect, lines) + set display& + + call s:close_windows() +endfunc + +func Test_breakindent_list_split() + 10new + 61vsplit + setlocal tabstop=8 breakindent list listchars=tab:<->,eol:$ + put =s:input + 30vsplit + setlocal listchars=eol:$ + let expect = [ + \ "^IabcdefghijklmnopqrstuvwxyzAB|<------>abcdefghijklmnopqrstuv", + \ " CDEFGHIJKLMNOP$ | wxyzABCDEFGHIJKLMNOP$ ", + \ "~ |~ " + \ ] + redraw! + let lines = s:screen_lines(line('.'), 61) + call s:compare_lines(expect, lines) + wincmd p + redraw! + let lines = s:screen_lines(line('.'), 61) + call s:compare_lines(expect, lines) + + bwipe! +endfunc " vim: shiftwidth=2 sts=2 expandtab |