Mercurial > vim
comparison src/textprop.c @ 22331:0271c2b8bb35 v8.2.1714
patch 8.2.1714: text properties corrupted with substitute command
Commit: https://github.com/vim/vim/commit/8902b31f1b31c117915defc23ac45cdc1f5c671b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 20 21:04:35 2020 +0200
patch 8.2.1714: text properties corrupted with substitute command
Problem: Text properties corrupted with substitute command. (Filipe
Brandenburger)
Solution: Get the changed line again after using u_savesub(). (closes #6984)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 20 Sep 2020 21:15:04 +0200 |
parents | 9d3dfd420a45 |
children | b545334ae654 |
comparison
equal
deleted
inserted
replaced
22330:ca6d4f7199a9 | 22331:0271c2b8bb35 |
---|---|
1347 // Save for undo if requested and not done yet. | 1347 // Save for undo if requested and not done yet. |
1348 if ((flags & APC_SAVE_FOR_UNDO) && !dirty | 1348 if ((flags & APC_SAVE_FOR_UNDO) && !dirty |
1349 && u_savesub(lnum) == FAIL) | 1349 && u_savesub(lnum) == FAIL) |
1350 return FALSE; | 1350 return FALSE; |
1351 dirty = TRUE; | 1351 dirty = TRUE; |
1352 | |
1353 // u_savesub() may have updated curbuf->b_ml, fetch it again | |
1354 if (curbuf->b_ml.ml_line_lnum != lnum) | |
1355 proplen = get_text_props(curbuf, lnum, &props, TRUE); | |
1352 } | 1356 } |
1353 if (res.can_drop) | 1357 if (res.can_drop) |
1354 continue; // Drop this text property | 1358 continue; // Drop this text property |
1355 mch_memmove(props + wi * sizeof(textprop_T), &prop, sizeof(textprop_T)); | 1359 mch_memmove(props + wi * sizeof(textprop_T), &prop, sizeof(textprop_T)); |
1356 ++wi; | 1360 ++wi; |