Mercurial > vim
comparison src/undo.c @ 29002:48d74a5822eb v8.2.5023
patch 8.2.5023: substitute overwrites allocated buffer
Commit: https://github.com/vim/vim/commit/338f1fc0ee3ca929387448fe464579d6113fa76a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 26 15:56:23 2022 +0100
patch 8.2.5023: substitute overwrites allocated buffer
Problem: Substitute overwrites allocated buffer.
Solution: Disallow undo when in a substitute command.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 26 May 2022 17:00:05 +0200 |
parents | 58d2315b096e |
children | 45c182c4f7e9 |
comparison
equal
deleted
inserted
replaced
29001:b41690e48e21 | 29002:48d74a5822eb |
---|---|
2325 int dosec = sec; | 2325 int dosec = sec; |
2326 int dofile = file; | 2326 int dofile = file; |
2327 int above = FALSE; | 2327 int above = FALSE; |
2328 int did_undo = TRUE; | 2328 int did_undo = TRUE; |
2329 | 2329 |
2330 if (text_locked()) | |
2331 { | |
2332 text_locked_msg(); | |
2333 return; | |
2334 } | |
2335 | |
2330 // First make sure the current undoable change is synced. | 2336 // First make sure the current undoable change is synced. |
2331 if (curbuf->b_u_synced == FALSE) | 2337 if (curbuf->b_u_synced == FALSE) |
2332 u_sync(TRUE); | 2338 u_sync(TRUE); |
2333 | 2339 |
2334 u_newcount = 0; | 2340 u_newcount = 0; |