diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-11-03 12:26:38 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-11-05 12:18:29 +0100 |
commit | 68cb4a7405ea9f8841d1f25ee8997c49e77fa679 (patch) | |
tree | f2766eca6c0cb9fefb9739ffc3256649ba8d4a61 /src/nvim/marktree.c | |
parent | 92e99bb1058dd837c451675175efb8511c5f8e15 (diff) | |
download | rneovim-68cb4a7405ea9f8841d1f25ee8997c49e77fa679.tar.gz rneovim-68cb4a7405ea9f8841d1f25ee8997c49e77fa679.tar.bz2 rneovim-68cb4a7405ea9f8841d1f25ee8997c49e77fa679.zip |
feat(extmarks): add "undo_restore" flag to opt out of undo-restoring
It is a design goal of extmarks that they allow precise tracking
of changes across undo/redo, including restore the exact positions
after a do/undo or undo/redo cycle. However this behavior is not useful
for all usecases. Many plugins won't keep marks around for long after
text changes, but uses them more like a cache until some external source
(like LSP semantic highlights) has fully updated to changed text and
then will explicitly readjust/replace extmarks as needed.
Add a "undo_restore" flag which is true by default (matches existing
behavior) but can be set to false to opt-out of this behavior.
Delete dead u_extmark_set() code.
Diffstat (limited to 'src/nvim/marktree.c')
-rw-r--r-- | src/nvim/marktree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c index 8ab9370e6c..3df659b8e1 100644 --- a/src/nvim/marktree.c +++ b/src/nvim/marktree.c @@ -2007,7 +2007,7 @@ void marktree_put_test(MarkTree *b, uint32_t ns, uint32_t id, int row, int col, int end_row, int end_col, bool end_right) { MTKey key = { { row, col }, ns, id, 0, - mt_flags(right_gravity, 0), 0, NULL }; + mt_flags(right_gravity, 0, false), 0, NULL }; marktree_put(b, key, end_row, end_col, end_right); } |