commit d88814ef68b3f2ad3ed005ee0683eff063b017a6
parent 4615d46f93fb0b15a427f428bb1e652b4ccb873b
Author: Luuk van Baal <luukvbaal@gmail.com>
Date: Wed, 17 Jan 2024 01:55:28 +0100
fix(column): remove sign from line it was previously on with undo
Diffstat:
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
@@ -2389,7 +2389,9 @@ static void u_undoredo(bool undo, bool do_buf_event)
// When text has been changed, possibly the start of the next line
// may have SpellCap that should be removed or it needs to be
// displayed. Schedule the next line for redrawing just in case.
- if (spell_check_window(curwin) && bot <= curbuf->b_ml.ml_line_count) {
+ // Also just in case the line had a sign which needs to be removed.
+ if ((spell_check_window(curwin) || curbuf->b_signs_with_text)
+ && bot <= curbuf->b_ml.ml_line_count) {
redrawWinline(curwin, bot);
}
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
@@ -548,4 +548,21 @@ describe('Signs', function()
delete | redraw | undo
]])
end)
+
+ it('sign not shown on line it was previously on after undo', function()
+ exec([[
+ call setline(1, range(1, 4))
+ call nvim_buf_set_extmark(0, nvim_create_namespace(''), 1, 0, {'sign_text':'S1'})
+ ]])
+ exec('norm 2Gdd')
+ exec('silent undo')
+ screen:expect([[
+ {2: }1 |
+ S1^2 |
+ {2: }3 |
+ {2: }4 |
+ {0:~ }|*9
+ |
+ ]])
+ end)
end)