aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 2c674e06e6..81c7ecab5f 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2724,7 +2724,7 @@ do_ecmd (
/* close the link to the current buffer */
u_sync(FALSE);
close_buffer(oldwin, curbuf,
- (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD, FALSE);
+ (flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD, FALSE);
/* Autocommands may open a new window and leave oldwin open
* which leads to crashes since the above call sets
@@ -3656,7 +3656,7 @@ void do_sub(exarg_T *eap)
if (eap->skip) /* not executing commands, only parsing */
return;
- if (!do_count && !curbuf->b_p_ma) {
+ if (!do_count && !MODIFIABLE(curbuf)) {
/* Substitution is not allowed in non-'modifiable' buffer */
EMSG(_(e_modifiable));
return;