0
0
mirror of https://github.com/vim/vim.git synced 2025-11-14 23:04:02 -05:00

patch 8.2.4947: text properties not adjusted when accepting spell suggestion

Problem:    Text properties not adjusted when accepting spell suggestion.
Solution:   Adjust text properties when text changes. (closes #10414)
This commit is contained in:
LemonBoy
2022-05-13 12:41:50 +01:00
committed by Bram Moolenaar
parent 7f8a3b11bf
commit b7a7012555
4 changed files with 55 additions and 0 deletions

View File

@@ -681,6 +681,8 @@ spell_suggest(int count)
p = alloc(STRLEN(line) - stp->st_orglen + stp->st_wordlen + 1);
if (p != NULL)
{
int len_diff = stp->st_wordlen - stp->st_orglen;
c = (int)(sug.su_badptr - line);
mch_memmove(p, line, c);
STRCPY(p + c, stp->st_word);
@@ -698,6 +700,9 @@ spell_suggest(int count)
curwin->w_cursor.col = c;
changed_bytes(curwin->w_cursor.lnum, c);
if (curbuf->b_has_textprop && len_diff != 0)
adjust_prop_columns(curwin->w_cursor.lnum, c, len_diff,
APC_SUBSTITUTE);
}
}
else