mirror of
https://github.com/neovim/neovim.git
synced 2025-09-22 19:18:34 +00:00
@@ -2822,6 +2822,16 @@ win_line (
|
|||||||
n_extra = wp->w_p_rl ? (col + 1) : (grid->Columns - col);
|
n_extra = wp->w_p_rl ? (col + 1) : (grid->Columns - col);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (draw_state == WL_LINE
|
||||||
|
&& foldinfo.fi_level != 0
|
||||||
|
&& foldinfo.fi_lines > 0
|
||||||
|
&& col >= grid->Columns
|
||||||
|
&& n_extra != 0
|
||||||
|
&& row == startrow) {
|
||||||
|
// Truncate the folding.
|
||||||
|
n_extra = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (draw_state == WL_LINE && (area_highlighting || has_spell)) {
|
if (draw_state == WL_LINE && (area_highlighting || has_spell)) {
|
||||||
// handle Visual or match highlighting in this line
|
// handle Visual or match highlighting in this line
|
||||||
if (vcol == fromcol
|
if (vcol == fromcol
|
||||||
|
@@ -6,6 +6,8 @@ local feed_command = helpers.feed_command
|
|||||||
local insert = helpers.insert
|
local insert = helpers.insert
|
||||||
local funcs = helpers.funcs
|
local funcs = helpers.funcs
|
||||||
local meths = helpers.meths
|
local meths = helpers.meths
|
||||||
|
local source = helpers.source
|
||||||
|
local assert_alive = helpers.assert_alive
|
||||||
|
|
||||||
describe("folded lines", function()
|
describe("folded lines", function()
|
||||||
local screen
|
local screen
|
||||||
@@ -357,4 +359,26 @@ describe("folded lines", function()
|
|||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('does not crash when foldtext is longer than columns #12988', function()
|
||||||
|
source([[
|
||||||
|
function! MyFoldText() abort
|
||||||
|
return repeat('-', &columns + 100)
|
||||||
|
endfunction
|
||||||
|
]])
|
||||||
|
command('set foldtext=MyFoldText()')
|
||||||
|
feed("i<cr><esc>")
|
||||||
|
feed("vkzf")
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{5:^---------------------------------------------}|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
assert_alive()
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user