Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
28930:6e65441d09a5 | 28931:b57caac54649 |
---|---|
1116 | 1116 |
1117 // Replace the line in the buffer. | 1117 // Replace the line in the buffer. |
1118 ml_replace(lnum, newp, FALSE); | 1118 ml_replace(lnum, newp, FALSE); |
1119 | 1119 |
1120 // mark the buffer as changed and prepare for displaying | 1120 // mark the buffer as changed and prepare for displaying |
1121 inserted_bytes(lnum, col, newlen - oldlen); | 1121 changed_bytes(lnum, col); |
1122 #ifdef FEAT_PROP_POPUP | |
1123 if (curbuf->b_has_textprop && newlen != oldlen) | |
1124 adjust_prop_columns(lnum, col, newlen - oldlen, | |
1125 State & REPLACE_FLAG ? APC_SUBSTITUTE : 0); | |
1126 #endif | |
1122 | 1127 |
1123 // If we're in Insert or Replace mode and 'showmatch' is set, then briefly | 1128 // If we're in Insert or Replace mode and 'showmatch' is set, then briefly |
1124 // show the match for right parens and braces. | 1129 // show the match for right parens and braces. |
1125 if (p_sm && (State & MODE_INSERT) | 1130 if (p_sm && (State & MODE_INSERT) |
1126 && msg_silent == 0 | 1131 && msg_silent == 0 |