diff src/ex_cmds.c @ 823:9ab23f1e137f v7.0c12

updated for version 7.0c12
author vimboss
date Fri, 07 Apr 2006 21:40:07 +0000
parents a2b128f7d705
children 6675076019ae
line wrap: on
line diff
--- 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, &regmatch) == FAIL)
     {
 	if (do_error)