mirror of
https://github.com/neovim/neovim.git
synced 2026-08-26 17:11:48 +00:00
fix(ui2): offset extmarks copied to pager by srow #41425
Problem: wrong end_row when copying extmarks to the pager buffer when expanding a message. Results in incorrect highlights or errors such as "invalid `end_col` out of range". Solution: don't forget to offset end_row by srow, as is already done for the copied lines and extmark rows.
This commit is contained in:
@@ -1346,4 +1346,44 @@ describe('messages2', function()
|
||||
end)
|
||||
screen:expect_unchanged()
|
||||
end)
|
||||
|
||||
it('correct end_row for highlights copied to pager #41419', function()
|
||||
command('echo "a" | echo "b"') -- Two lines; end_row should be offset by 2
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*10
|
||||
{3: }|
|
||||
a |
|
||||
b |
|
||||
]])
|
||||
feed('g<lt>')
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*9
|
||||
{3: }|
|
||||
^a |
|
||||
b |
|
||||
|
|
||||
]])
|
||||
command('echohl WarningMsg | echo "c" | echohl ErrorMsg | echo "de"')
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*7
|
||||
{3: }|
|
||||
^a |
|
||||
b |
|
||||
{19:c} |
|
||||
{9:de} |
|
||||
|
|
||||
]])
|
||||
feed('g<lt>')
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*9
|
||||
{3: }|
|
||||
{19:^c} |
|
||||
{9:de} |
|
||||
|
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user