mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
fix(screen): check for col instead of vcol when drawing fold (#19572)
This commit is contained in:
@@ -2909,7 +2909,7 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
|
||||
|
||||
if (draw_state == WL_LINE
|
||||
&& has_fold
|
||||
&& vcol == 0
|
||||
&& col == win_col_offset
|
||||
&& n_extra == 0
|
||||
&& row == startrow) {
|
||||
char_attr = win_hl_attr(wp, HLF_FL);
|
||||
|
@@ -1818,6 +1818,83 @@ describe("folded lines", function()
|
||||
]])
|
||||
end
|
||||
end)
|
||||
|
||||
it('fold text is shown when text has been scrolled to the right #19123', function()
|
||||
insert(content1)
|
||||
command('set number nowrap')
|
||||
command('3,4fold')
|
||||
feed('gg')
|
||||
if multigrid then
|
||||
screen:expect([[
|
||||
## grid 1
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[3:---------------------------------------------]|
|
||||
## grid 2
|
||||
{8: 1 }^This is a |
|
||||
{8: 2 }valid English |
|
||||
{8: 3 }{5:+-- 2 lines: sentence composed by·······}|
|
||||
{8: 5 }in his cave. |
|
||||
{8: 6 } |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
## grid 3
|
||||
|
|
||||
]])
|
||||
else
|
||||
screen:expect([[
|
||||
{8: 1 }^This is a |
|
||||
{8: 2 }valid English |
|
||||
{8: 3 }{5:+-- 2 lines: sentence composed by·······}|
|
||||
{8: 5 }in his cave. |
|
||||
{8: 6 } |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
end
|
||||
|
||||
feed('zl')
|
||||
if multigrid then
|
||||
screen:expect([[
|
||||
## grid 1
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[2:---------------------------------------------]|
|
||||
[3:---------------------------------------------]|
|
||||
## grid 2
|
||||
{8: 1 }^his is a |
|
||||
{8: 2 }alid English |
|
||||
{8: 3 }{5:+-- 2 lines: sentence composed by·······}|
|
||||
{8: 5 }n his cave. |
|
||||
{8: 6 } |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
## grid 3
|
||||
|
|
||||
]])
|
||||
else
|
||||
screen:expect([[
|
||||
{8: 1 }^his is a |
|
||||
{8: 2 }alid English |
|
||||
{8: 3 }{5:+-- 2 lines: sentence composed by·······}|
|
||||
{8: 5 }n his cave. |
|
||||
{8: 6 } |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
describe("with ext_multigrid", function()
|
||||
|
Reference in New Issue
Block a user