patch 7.4.2312
Problem:    Crash when autocommand moves to another tab. (Dominique Pelle)
Solution:   When navigating to another window halfway the :edit command go
            back to the right window.
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 110a95a..1627ee7 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -2133,12 +2133,17 @@
     void
 text_locked_msg(void)
 {
+    EMSG(_(get_text_locked_msg()));
+}
+
+    char_u *
+get_text_locked_msg(void)
+{
 #ifdef FEAT_CMDWIN
     if (cmdwin_type != 0)
-	EMSG(_(e_cmdwin));
-    else
+	return e_cmdwin;
 #endif
-	EMSG(_(e_secure));
+    return e_secure;
 }
 
 #if defined(FEAT_AUTOCMD) || defined(PROTO)