diff options
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index bf0372178..790b30ef1 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -4287,6 +4287,13 @@ do_sub(eap) if (eap->skip) /* not executing commands, only parsing */ return; + if (!do_count && !curbuf->b_p_ma) + { + /* Substitusion is not allowed in non-'modifiable' buffer */ + EMSG(_(e_modifiable)); + return; + } + if (search_regcomp(pat, RE_SUBST, which_pat, SEARCH_HIS, ®match) == FAIL) { if (do_error) |