mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 14:56:08 +00:00
fix(marks): clamp conceal_lines corrected line number #33464
Problem: Line number corrected for conceal_lines may be set beyond eob
when the last buffer line is concealed, causing ml_get errors.
Solution: Avoid setting line number beyond eob.
(cherry picked from commit 3341ab0776
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
e4007551c4
commit
4d87229789
@@ -2086,8 +2086,15 @@ describe('ui/mouse/input', function()
|
||||
it('below a concealed line #33450', function()
|
||||
api.nvim_set_option_value('conceallevel', 2, {})
|
||||
api.nvim_buf_set_extmark(0, api.nvim_create_namespace(''), 1, 0, { conceal_lines = '' })
|
||||
api.nvim_input_mouse('right', 'press', '', 0, 1, 0)
|
||||
api.nvim_input_mouse('right', 'release', '', 0, 1, 0)
|
||||
api.nvim_input_mouse('left', 'press', '', 0, 1, 0)
|
||||
api.nvim_input_mouse('left', 'release', '', 0, 1, 0)
|
||||
eq(3, fn.line('.'))
|
||||
-- No error when clicking below last line that is concealed.
|
||||
screen:try_resize(80, 10) -- Prevent hit-enter
|
||||
api.nvim_set_option_value('cmdheight', 3, {})
|
||||
local count = api.nvim_buf_line_count(0)
|
||||
api.nvim_buf_set_extmark(0, 1, count - 1, 0, { conceal_lines = '' })
|
||||
api.nvim_input_mouse('left', 'press', '', 0, count, 0)
|
||||
eq('', api.nvim_get_vvar('errmsg'))
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user