mirror of
https://github.com/neovim/neovim.git
synced 2025-09-22 11:18:19 +00:00
vim-patch:8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Problem: 'listchars' "exceeds" character appears in foldcolumn. Window
separator is missing. (Leonid V. Fedorenchik)
Solution: Only draw the "exceeds" character in the text area. Break the
loop when not drawing the text. (closes vim/vim#8524)
41fb723ee9
This commit is contained in:
@@ -4232,6 +4232,7 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
|
|||||||
// Show "extends" character from 'listchars' if beyond the line end and
|
// Show "extends" character from 'listchars' if beyond the line end and
|
||||||
// 'list' is set.
|
// 'list' is set.
|
||||||
if (wp->w_p_lcs_chars.ext != NUL
|
if (wp->w_p_lcs_chars.ext != NUL
|
||||||
|
&& draw_state == WL_LINE
|
||||||
&& wp->w_p_list
|
&& wp->w_p_list
|
||||||
&& !wp->w_p_wrap
|
&& !wp->w_p_wrap
|
||||||
&& filler_todo <= 0
|
&& filler_todo <= 0
|
||||||
@@ -4427,7 +4428,8 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
|
|||||||
*/
|
*/
|
||||||
if ((wp->w_p_rl ? (col < 0) : (col >= grid->Columns))
|
if ((wp->w_p_rl ? (col < 0) : (col >= grid->Columns))
|
||||||
&& foldinfo.fi_lines == 0
|
&& foldinfo.fi_lines == 0
|
||||||
&& (*ptr != NUL
|
&& (draw_state != WL_LINE
|
||||||
|
|| *ptr != NUL
|
||||||
|| filler_todo > 0
|
|| filler_todo > 0
|
||||||
|| (wp->w_p_list && wp->w_p_lcs_chars.eol != NUL
|
|| (wp->w_p_list && wp->w_p_lcs_chars.eol != NUL
|
||||||
&& p_extra != at_end_str)
|
&& p_extra != at_end_str)
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
" Tests for 'listchars' display with 'list' and :list
|
" Tests for 'listchars' display with 'list' and :list
|
||||||
|
|
||||||
|
source check.vim
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
|
source screendump.vim
|
||||||
|
|
||||||
func Test_listchars()
|
func Test_listchars()
|
||||||
enew!
|
enew!
|
||||||
@@ -517,4 +519,34 @@ func Test_listchars_window_local()
|
|||||||
set list& listchars&
|
set list& listchars&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_listchars_foldcolumn()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
call setline(1, ['aaa', '', 'a', 'aaaaaa'])
|
||||||
|
vsplit
|
||||||
|
vsplit
|
||||||
|
windo set signcolumn=yes foldcolumn=1 winminwidth=0 nowrap list listchars=extends:>,precedes:<
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XTest_listchars')
|
||||||
|
|
||||||
|
let buf = RunVimInTerminal('-S XTest_listchars', {'rows': 10, 'cols': 60})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, "13\<C-W>>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_listchars_01', {})
|
||||||
|
call term_sendkeys(buf, "\<C-W>>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_listchars_02', {})
|
||||||
|
call term_sendkeys(buf, "\<C-W>>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_listchars_03', {})
|
||||||
|
call term_sendkeys(buf, "\<C-W>>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_listchars_04', {})
|
||||||
|
call term_sendkeys(buf, "\<C-W>>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_listchars_05', {})
|
||||||
|
|
||||||
|
" clean up
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('XTest_listchars')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
-- Tests for 'listchars' display with 'list' and :list.
|
-- Tests for 'listchars' display with 'list' and :list.
|
||||||
|
|
||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
|
local Screen = require('test.functional.ui.screen')
|
||||||
|
local feed, insert, exec = helpers.feed, helpers.insert, helpers.exec
|
||||||
local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect
|
local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect
|
||||||
|
|
||||||
-- luacheck: ignore 621 (Indentation)
|
-- luacheck: ignore 621 (Indentation)
|
||||||
@@ -13,7 +14,7 @@ describe("'listchars'", function()
|
|||||||
|
|
||||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||||
it("works with 'list'", function()
|
it("works with 'list'", function()
|
||||||
source([[
|
exec([[
|
||||||
function GetScreenCharsForLine(lnum)
|
function GetScreenCharsForLine(lnum)
|
||||||
return join(map(range(1, virtcol('$')), 'nr2char(screenchar(a:lnum, v:val))'), '')
|
return join(map(range(1, virtcol('$')), 'nr2char(screenchar(a:lnum, v:val))'), '')
|
||||||
endfunction
|
endfunction
|
||||||
@@ -98,4 +99,80 @@ describe("'listchars'", function()
|
|||||||
.....h>-$
|
.....h>-$
|
||||||
iii<<<<><<$]])
|
iii<<<<><<$]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('"exceeds" character does not appear in foldcolumn vim-patch:8.2.3121', function()
|
||||||
|
local screen = Screen.new(60, 10)
|
||||||
|
screen:attach()
|
||||||
|
exec([[
|
||||||
|
call setline(1, ['aaa', '', 'a', 'aaaaaa'])
|
||||||
|
vsplit
|
||||||
|
vsplit
|
||||||
|
windo set signcolumn=yes foldcolumn=1 winminwidth=0 nowrap list listchars=extends:>,precedes:<
|
||||||
|
]])
|
||||||
|
feed('13<C-W>>')
|
||||||
|
screen:expect([[
|
||||||
|
aaa │ a>│ ^aaa |
|
||||||
|
│ │ |
|
||||||
|
a │ a │ a |
|
||||||
|
aaaaaa │ a>│ aaaaaa |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
[No Name] [+] <[+] [No Name] [+] |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-W>>')
|
||||||
|
screen:expect([[
|
||||||
|
aaa │ >│ ^aaa |
|
||||||
|
│ │ |
|
||||||
|
a │ a│ a |
|
||||||
|
aaaaaa │ >│ aaaaaa |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
[No Name] [+] <+] [No Name] [+] |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-W>>')
|
||||||
|
screen:expect([[
|
||||||
|
aaa │ │ ^aaa |
|
||||||
|
│ │ |
|
||||||
|
a │ │ a |
|
||||||
|
aaaaaa │ │ aaaaaa |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
[No Name] [+] <] [No Name] [+] |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-W>>')
|
||||||
|
screen:expect([[
|
||||||
|
aaa │ │ ^aaa |
|
||||||
|
│ │ |
|
||||||
|
a │ │ a |
|
||||||
|
aaaaaa │ │ aaaaaa |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
~ │~ │~ |
|
||||||
|
[No Name] [+] < [No Name] [+] |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-W>>')
|
||||||
|
screen:expect([[
|
||||||
|
aaa │ │ ^aaa |
|
||||||
|
│ │ |
|
||||||
|
a │ │ a |
|
||||||
|
aaaaaa │ │ aaaaaa |
|
||||||
|
~ │~│~ |
|
||||||
|
~ │~│~ |
|
||||||
|
~ │~│~ |
|
||||||
|
~ │~│~ |
|
||||||
|
[No Name] [+] < [No Name] [+] |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user