mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 21:18:34 +00:00
vim-patch:8.1.1345: stuck in sandbox with ":s/../\=Function/gn"
Problem: Stuck in sandbox with ":s/../\=Function/gn".
Solution: Don't skip over code to restore sandbox. (Christian Brabandt)
6349e9411f
This commit is contained in:
@@ -3819,7 +3819,6 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout,
|
||||
if (!preview || has_second_delim) {
|
||||
if (subflags.do_count) {
|
||||
// prevent accidentally changing the buffer by a function
|
||||
save_ma = curbuf->b_p_ma;
|
||||
curbuf->b_p_ma = false;
|
||||
sandbox++;
|
||||
}
|
||||
@@ -3832,13 +3831,9 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout,
|
||||
sub, sub_firstline, false, p_magic, true);
|
||||
// If getting the substitute string caused an error, don't do
|
||||
// the replacement.
|
||||
if (aborting()) {
|
||||
goto skip;
|
||||
}
|
||||
|
||||
// Don't keep flags set by a recursive call
|
||||
subflags = subflags_save;
|
||||
if (subflags.do_count) {
|
||||
if (aborting() || subflags.do_count) {
|
||||
curbuf->b_p_ma = save_ma;
|
||||
if (sandbox > 0) {
|
||||
sandbox--;
|
||||
|
Reference in New Issue
Block a user