updated for version 7.0182
diff --git a/src/buffer.c b/src/buffer.c
index 1190117..677215d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1806,10 +1806,11 @@
     if (buf == curbuf)
 	return OK;
 
-#ifdef FEAT_CMDWIN
-    if (cmdwin_type != 0)
+    if (editing_cmdline())
+    {
+	editing_cmdline_msg();
 	return FAIL;
-#endif
+    }
 
     /* altfpos may be changed by getfile(), get it now */
     if (lnum == 0)