From d2dc7cfa5b930a1ff68426f3d47809508ac7d392 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Wed, 24 May 2023 20:26:03 +0200 Subject: vim-patch:9.0.0608: with spelling, deleting a full stop does not update next line Problem: With spell checking, deleting a full stop at the end of a line does not update SpellCap at the start of the next line. Solution: Update the next line when characters have been deleted. Also when using undo. https://github.com/vim/vim/commit/26f09ea54b2c60abf21df42c60bdfc60eca17b0d Co-authored-by: Bram Moolenaar --- src/nvim/change.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/change.c') diff --git a/src/nvim/change.c b/src/nvim/change.c index f4969d0ca9..ebbb0d4db6 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -43,6 +43,7 @@ #include "nvim/plines.h" #include "nvim/pos.h" #include "nvim/search.h" +#include "nvim/spell.h" #include "nvim/state.h" #include "nvim/strings.h" #include "nvim/textformat.h" @@ -393,6 +394,12 @@ void changed_bytes(linenr_T lnum, colnr_T col) { changedOneline(curbuf, lnum); changed_common(lnum, col, lnum + 1, 0); + // When text has been changed at the end of the line, 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) && lnum < curbuf->b_ml.ml_line_count) { + redrawWinline(curwin, lnum + 1); + } // notify any channels that are watching buf_updates_send_changes(curbuf, lnum, 1, 1); -- cgit