vim-patch:8.2.4379: an empty change is reported to a listener

Problem:    An empty change is reported to a listener.
Solution:   Do not report an empty change. (closes vim/vim#9768)  Remove unused
            return value.

55737c2a31

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2025-08-18 01:06:14 -04:00
parent 15d3a83999
commit 09964b7ef0

View File

@@ -2378,12 +2378,14 @@ static void u_undoredo(bool undo, bool do_buf_event)
} }
} }
changed_lines(curbuf, top + 1, 0, bot, newsize - oldsize, do_buf_event); if (oldsize > 0 || newsize > 0) {
// When text has been changed, possibly the start of the next line changed_lines(curbuf, top + 1, 0, bot, newsize - oldsize, do_buf_event);
// may have SpellCap that should be removed or it needs to be // When text has been changed, possibly the start of the next line
// displayed. Schedule the next line for redrawing just in case. // may have SpellCap that should be removed or it needs to be
if (spell_check_window(curwin) && bot <= curbuf->b_ml.ml_line_count) { // displayed. Schedule the next line for redrawing just in case.
redrawWinline(curwin, bot); if (spell_check_window(curwin) && bot <= curbuf->b_ml.ml_line_count) {
redrawWinline(curwin, bot);
}
} }
// Set the '[ mark. // Set the '[ mark.