diff src/change.c @ 28931:b57caac54649 v8.2.4988

patch 8.2.4988: textprop in wrong position when replacing multi-byte chars Commit: https://github.com/vim/vim/commit/0d534d9cf2ae95fc85ef7fe048d9ff590586a6a6 Author: LemonBoy <thatlemon@gmail.com> Date: Sat May 21 11:20:42 2022 +0100 patch 8.2.4988: textprop in wrong position when replacing multi-byte chars Problem: Textprop in wrong position when replacing multi-byte chars. Solution: Adjust textprop position. (closes https://github.com/vim/vim/issues/10461)
author Bram Moolenaar <Bram@vim.org>
date Sat, 21 May 2022 12:30:03 +0200
parents aa44d5842d6c
children 6cdf55afaae9
line wrap: on
line diff
--- a/src/change.c
+++ b/src/change.c
@@ -1118,7 +1118,12 @@ ins_char_bytes(char_u *buf, int charlen)
     ml_replace(lnum, newp, FALSE);
 
     // mark the buffer as changed and prepare for displaying
-    inserted_bytes(lnum, col, newlen - oldlen);
+    changed_bytes(lnum, col);
+#ifdef FEAT_PROP_POPUP
+    if (curbuf->b_has_textprop && newlen != oldlen)
+	adjust_prop_columns(lnum, col, newlen - oldlen,
+				    State & REPLACE_FLAG ? APC_SUBSTITUTE : 0);
+#endif
 
     // If we're in Insert or Replace mode and 'showmatch' is set, then briefly
     // show the match for right parens and braces.