Mercurial > vim
comparison src/testdir/test_listchars.vim @ 23825:0bd44e94dd14 v8.2.2454
patch 8.2.2454: leading space can not be made visible
Commit: https://github.com/vim/vim/commit/91478ae49a1b2dc1de63821db731a343e855dcc0
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 3 15:58:13 2021 +0100
patch 8.2.2454: leading space can not be made visible
Problem: Leading space can not be made visible.
Solution: Add "lead:" to 'listchars'. (closes https://github.com/vim/vim/issues/7772)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 03 Feb 2021 16:00:07 +0100 |
parents | 08940efa6b4e |
children | 44be09b25619 |
comparison
equal
deleted
inserted
replaced
23824:8b7e3139961a | 23825:0bd44e94dd14 |
---|---|
108 \ '..fff>--<<$', | 108 \ '..fff>--<<$', |
109 \ '>-------gg>-----$', | 109 \ '>-------gg>-----$', |
110 \ '.....h>-$', | 110 \ '.....h>-$', |
111 \ 'iii<<<<><<$', '$'], l) | 111 \ 'iii<<<<><<$', '$'], l) |
112 | 112 |
113 " Test lead and trail | |
114 normal ggdG | |
115 set listchars& | |
116 set listchars+=lead:>,trail:<,space:x | |
117 set list | |
118 | |
119 call append(0, [ | |
120 \ ' ffff ', | |
121 \ ' gg', | |
122 \ 'h ', | |
123 \ ' ', | |
124 \ ' 0 0 ', | |
125 \ ]) | |
126 | |
127 let expected = [ | |
128 \ '>>>>ffff<<<<$', | |
129 \ '>>>>>>>>>>gg$', | |
130 \ 'h<<<<<<<<<<<$', | |
131 \ '<<<<<<<<<<<<$', | |
132 \ '>>>>0xx0<<<<$', | |
133 \ '$' | |
134 \ ] | |
135 redraw! | |
136 for i in range(1, 5) | |
137 call cursor(i, 1) | |
138 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) | |
139 endfor | |
140 | |
141 call assert_equal(expected, split(execute("%list"), "\n")) | |
113 | 142 |
114 " test nbsp | 143 " test nbsp |
115 normal ggdG | 144 normal ggdG |
116 set listchars=nbsp:X,trail:Y | 145 set listchars=nbsp:X,trail:Y |
117 set list | 146 set list |