mirror of
https://github.com/neovim/neovim.git
synced 2026-04-21 06:45:37 +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.
This commit is contained in:
@@ -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