mirror of
https://github.com/neovim/neovim
synced 2025-07-17 01:31:48 +00:00
fix(decor): set invalid flag for end of invalidated paired marks
(cherry picked from commit 87610d82db
)
This commit is contained in:
committed by
github-actions[bot]
parent
87440e7bc5
commit
2bc5e1be0f
@ -139,8 +139,9 @@ static void extmark_setraw(buf_T *buf, uint64_t mark, int row, colnr_T col, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (invalid) {
|
if (invalid) {
|
||||||
row2 = mt_paired(key) ? marktree_get_altpos(buf->b_marktree, key, NULL).row : row;
|
MTPos end = marktree_get_altpos(buf->b_marktree, key, itr);
|
||||||
buf_put_decor(buf, mt_decor(key), row, row2);
|
mt_itr_rawkey(itr).flags &= (uint16_t) ~MT_FLAG_INVALID;
|
||||||
|
buf_put_decor(buf, mt_decor(key), row, end.row);
|
||||||
} else if (move && key.flags & MT_FLAG_DECOR_SIGNTEXT && buf->b_signcols.autom) {
|
} else if (move && key.flags & MT_FLAG_DECOR_SIGNTEXT && buf->b_signcols.autom) {
|
||||||
buf_signcols_count_range(buf, row1, row2, 0, kNone);
|
buf_signcols_count_range(buf, row1, row2, 0, kNone);
|
||||||
}
|
}
|
||||||
@ -387,7 +388,8 @@ void extmark_splice_delete(buf_T *buf, int l_row, colnr_T l_col, int u_row, coln
|
|||||||
bool invalidated = false;
|
bool invalidated = false;
|
||||||
// Invalidate/delete mark
|
// Invalidate/delete mark
|
||||||
if (!only_copy && !mt_invalid(mark) && mt_invalidate(mark) && !mt_end(mark)) {
|
if (!only_copy && !mt_invalid(mark) && mt_invalidate(mark) && !mt_end(mark)) {
|
||||||
MTPos endpos = marktree_get_altpos(buf->b_marktree, mark, NULL);
|
MarkTreeIter enditr[1] = { *itr };
|
||||||
|
MTPos endpos = marktree_get_altpos(buf->b_marktree, mark, enditr);
|
||||||
// Invalidate unpaired marks in deleted lines and paired marks whose entire
|
// Invalidate unpaired marks in deleted lines and paired marks whose entire
|
||||||
// range has been deleted.
|
// range has been deleted.
|
||||||
if ((!mt_paired(mark) && mark.pos.row < u_row)
|
if ((!mt_paired(mark) && mark.pos.row < u_row)
|
||||||
@ -402,6 +404,7 @@ void extmark_splice_delete(buf_T *buf, int l_row, colnr_T l_col, int u_row, coln
|
|||||||
copy = true;
|
copy = true;
|
||||||
invalidated = true;
|
invalidated = true;
|
||||||
mt_itr_rawkey(itr).flags |= MT_FLAG_INVALID;
|
mt_itr_rawkey(itr).flags |= MT_FLAG_INVALID;
|
||||||
|
mt_itr_rawkey(enditr).flags |= MT_FLAG_INVALID;
|
||||||
marktree_revise_meta(buf->b_marktree, itr, mark);
|
marktree_revise_meta(buf->b_marktree, itr, mark);
|
||||||
buf_decor_remove(buf, mark.pos.row, endpos.row, mark.pos.col, mt_decor(mark), false);
|
buf_decor_remove(buf, mark.pos.row, endpos.row, mark.pos.col, mt_decor(mark), false);
|
||||||
}
|
}
|
||||||
|
@ -1797,6 +1797,16 @@ describe('API/extmarks', function()
|
|||||||
eq({}, get_extmark_by_id(ns, 4, {}))
|
eq({}, get_extmark_by_id(ns, 4, {}))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('no crash checking invalided flag of sign pair end key #31856', function()
|
||||||
|
api.nvim_buf_set_lines(0, 0, 1, false, { '', '' })
|
||||||
|
api.nvim_set_option_value('signcolumn', 'auto:2', {})
|
||||||
|
set_extmark(ns, 1, 0, 0, { sign_text = 'S1', invalidate = true, end_row = 0 })
|
||||||
|
set_extmark(ns, 2, 1, 0, { sign_text = 'S2', end_row = 1 })
|
||||||
|
command('d')
|
||||||
|
api.nvim_buf_clear_namespace(0, ns, 0, -1)
|
||||||
|
n.assert_alive()
|
||||||
|
end)
|
||||||
|
|
||||||
it('can set a URL', function()
|
it('can set a URL', function()
|
||||||
local url1 = 'https://example.com'
|
local url1 = 'https://example.com'
|
||||||
local url2 = 'http://127.0.0.1'
|
local url2 = 'http://127.0.0.1'
|
||||||
|
Reference in New Issue
Block a user