mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.0.0662: concealed characters do not work correctly (#23454)
Problem: Concealed characters do not work correctly.
Solution: Subtract boguscols instead of adding them. (closes vim/vim#11273)
7500866182
Code change is N/A as Nvim has a draw_col variable instead.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
parent
62ecb05957
commit
1975062d3c
@ -474,6 +474,39 @@ describe('Conceal', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- oldtest: Test_conceal_linebreak()
|
||||||
|
it('with linebreak', function()
|
||||||
|
local screen = Screen.new(75, 8)
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
|
||||||
|
})
|
||||||
|
screen:attach()
|
||||||
|
exec([[
|
||||||
|
let &wrap = v:true
|
||||||
|
let &conceallevel = 2
|
||||||
|
let &concealcursor = 'nc'
|
||||||
|
let &linebreak = v:true
|
||||||
|
let &showbreak = '+ '
|
||||||
|
let line = 'a`a`a`a`'
|
||||||
|
\ .. 'a'->repeat(&columns - 15)
|
||||||
|
\ .. ' b`b`'
|
||||||
|
\ .. 'b'->repeat(&columns - 10)
|
||||||
|
\ .. ' cccccc'
|
||||||
|
eval ['x'->repeat(&columns), '', line]->setline(1)
|
||||||
|
syntax region CodeSpan matchgroup=Delimiter start=/\z(`\+\)/ end=/\z1/ concealends
|
||||||
|
]])
|
||||||
|
screen:expect([[
|
||||||
|
^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|
||||||
|
|
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
||||||
|
{0:+ }bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
||||||
|
{0:+ }cccccc |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
-- Tests for correct display (cursor column position) with +conceal and tabulators.
|
-- Tests for correct display (cursor column position) with +conceal and tabulators.
|
||||||
-- oldtest: Test_conceal_cursor_pos()
|
-- oldtest: Test_conceal_cursor_pos()
|
||||||
it('cursor and column position with conceal and tabulators', function()
|
it('cursor and column position with conceal and tabulators', function()
|
||||||
|
@ -188,6 +188,32 @@ func Test_conceal_resize_term()
|
|||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_conceal_linebreak()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let code =<< trim [CODE]
|
||||||
|
vim9script
|
||||||
|
&wrap = true
|
||||||
|
&conceallevel = 2
|
||||||
|
&concealcursor = 'nc'
|
||||||
|
&linebreak = true
|
||||||
|
&showbreak = '+ '
|
||||||
|
var line: string = 'a`a`a`a`'
|
||||||
|
.. 'a'->repeat(&columns - 15)
|
||||||
|
.. ' b`b`'
|
||||||
|
.. 'b'->repeat(&columns - 10)
|
||||||
|
.. ' cccccc'
|
||||||
|
['x'->repeat(&columns), '', line]->setline(1)
|
||||||
|
syntax region CodeSpan matchgroup=Delimiter start=/\z(`\+\)/ end=/\z1/ concealends
|
||||||
|
[CODE]
|
||||||
|
call writefile(code, 'XTest_conceal_linebreak', 'D')
|
||||||
|
let buf = RunVimInTerminal('-S XTest_conceal_linebreak', {'rows': 8})
|
||||||
|
call VerifyScreenDump(buf, 'Test_conceal_linebreak_1', {})
|
||||||
|
|
||||||
|
" clean up
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Tests for correct display (cursor column position) with +conceal and
|
" Tests for correct display (cursor column position) with +conceal and
|
||||||
" tabulators. Need to run this test in a separate Vim instance. Otherwise the
|
" tabulators. Need to run this test in a separate Vim instance. Otherwise the
|
||||||
" screen is not updated (lazy redraw) and the cursor position is wrong.
|
" screen is not updated (lazy redraw) and the cursor position is wrong.
|
||||||
|
Loading…
Reference in New Issue
Block a user