commit | 338f1fc0ee3ca929387448fe464579d6113fa76a | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Thu May 26 15:56:23 2022 +0100 |
committer | Bram Moolenaar <Bram@vim.org> | Thu May 26 15:56:23 2022 +0100 |
tree | 008c1b86db6020483e7e24fc6318cd6da3663c61 | |
parent | 9bcb9ca9c7dd1632385dc3351b5e019739368658 [diff] [blame] |
patch 8.2.5023: substitute overwrites allocated buffer Problem: Substitute overwrites allocated buffer. Solution: Disallow undo when in a substitute command.
diff --git a/src/undo.c b/src/undo.c index cac09f0..81cc28e 100644 --- a/src/undo.c +++ b/src/undo.c
@@ -2327,6 +2327,12 @@ int above = FALSE; int did_undo = TRUE; + if (text_locked()) + { + text_locked_msg(); + return; + } + // First make sure the current undoable change is synced. if (curbuf->b_u_synced == FALSE) u_sync(TRUE);