diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2021-03-30 09:26:11 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-29 21:26:11 -0400 |
| commit | f89bfa68692540c2a28794297ce2ab63892de410 (patch) | |
| tree | 663ec8254eb7e5ecae1fb00b22bf2511052d8b42 /src/nvim/testdir | |
| parent | 291f1ece7f66b16155ad4d418d04be42c45df8ea (diff) | |
| download | rneovim-f89bfa68692540c2a28794297ce2ab63892de410.tar.gz rneovim-f89bfa68692540c2a28794297ce2ab63892de410.tar.bz2 rneovim-f89bfa68692540c2a28794297ce2ab63892de410.zip | |
vim-patch:8.2.2454: leading space can not be made visible (#14138)
Problem: Leading space can not be made visible.
Solution: Add "lead:" to 'listchars'. (closes vim/vim#7772)
https://github.com/vim/vim/commit/91478ae49a1b2dc1de63821db731a343e855dcc0
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_listchars.vim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_listchars.vim b/src/nvim/testdir/test_listchars.vim index dcc588120c..4cb609aaf0 100644 --- a/src/nvim/testdir/test_listchars.vim +++ b/src/nvim/testdir/test_listchars.vim @@ -110,6 +110,35 @@ func Test_listchars() \ '.....h>-$', \ 'iii<<<<><<$', '$'], l) + " Test lead and trail + normal ggdG + set listchars=eol:$ + set listchars+=lead:>,trail:<,space:x + set list + + call append(0, [ + \ ' ffff ', + \ ' gg', + \ 'h ', + \ ' ', + \ ' 0 0 ', + \ ]) + + let expected = [ + \ '>>>>ffff<<<<$', + \ '>>>>>>>>>>gg$', + \ 'h<<<<<<<<<<<$', + \ '<<<<<<<<<<<<$', + \ '>>>>0xx0<<<<$', + \ '$' + \ ] + redraw! + for i in range(1, 5) + call cursor(i, 1) + call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) + endfor + + call assert_equal(expected, split(execute("%list"), "\n")) " test nbsp normal ggdG |