diff src/testdir/test_listchars.vim @ 15502:bc17a9d37810 v8.1.0759

patch 8.1.0759: showing two characters for tab is limited commit https://github.com/vim/vim/commit/83a52171ba00b2b9fd2d1d22a07e38fc9fc69c1e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 16 22:41:54 2019 +0100 patch 8.1.0759: showing two characters for tab is limited Problem: Showing two characters for tab is limited. Solution: Allow for a third character for "tab:" in 'listchars'. (Nathaniel Braun, Ken Takata, closes #3810)
author Bram Moolenaar <Bram@vim.org>
date Wed, 16 Jan 2019 22:45:07 +0100
parents 90aaa974594e
children 52930462eec4
line wrap: on
line diff
--- a/src/testdir/test_listchars.vim
+++ b/src/testdir/test_listchars.vim
@@ -42,6 +42,38 @@ func Test_listchars()
     call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
   endfor
 
+  " tab with 3rd character.
+  set listchars-=tab:>-
+  set listchars+=tab:<=>,trail:-
+  let expected = [
+	      \ '<======>aa<====>$',
+	      \ '..bb<==>--$',
+	      \ '...cccc>-$',
+	      \ 'dd........ee--<>$',
+	      \ '-$'
+	      \ ]
+  redraw!
+  for i in range(1, 5)
+    call cursor(i, 1)
+    call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
+  endfor
+
+  set listchars-=trail:-
+  let expected = [
+	      \ '<======>aa<====>$',
+	      \ '..bb<==>..$',
+	      \ '...cccc>.$',
+	      \ 'dd........ee..<>$',
+	      \ '.$'
+	      \ ]
+  redraw!
+  for i in range(1, 5)
+    call cursor(i, 1)
+    call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
+  endfor
+
+  set listchars-=tab:<=>
+  set listchars+=tab:>-
   set listchars+=trail:<
   set nolist
   normal ggdG