]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0216: Error on exit with EXITFREE and 'winfixbuf' v9.1.0216
authorzeertzjq <zeertzjq@outlook.com>
Thu, 28 Mar 2024 09:11:57 +0000 (10:11 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 28 Mar 2024 09:11:57 +0000 (10:11 +0100)
Problem:  Error on exit with EXITFREE and 'winfixbuf'.
Solution: Handle DT_FREE before checking for 'winfixbuf'.
          (zeertzjq)

closes: #14314

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/tag.c
src/testdir/test_winfixbuf.vim
src/version.c

index 2ac0da266689841e3bd19b210f20af2e3e57f9f0..9117d0fd2731f9de07c35c1e396b7ea5166a2c29 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -289,17 +289,6 @@ do_tag(
     static char_u      **matches = NULL;
     static int         flags;
 
-    if (postponed_split == 0 && !check_can_set_curbuf_forceit(forceit))
-        return FALSE;
-
-#ifdef FEAT_EVAL
-    if (tfu_in_use)
-    {
-       emsg(_(e_cannot_modify_tag_stack_within_tagfunc));
-       return FALSE;
-    }
-#endif
-
 #ifdef EXITFREE
     if (type == DT_FREE)
     {
@@ -313,6 +302,17 @@ do_tag(
     }
 #endif
 
+#ifdef FEAT_EVAL
+    if (tfu_in_use)
+    {
+       emsg(_(e_cannot_modify_tag_stack_within_tagfunc));
+       return FALSE;
+    }
+#endif
+
+    if (postponed_split == 0 && !check_can_set_curbuf_forceit(forceit))
+        return FALSE;
+
     if (type == DT_HELP)
     {
        type = DT_TAG;
index 610e8e0bc7a84cb04a866cbc4ec2ff26b3f2c6e1..edf71f0e6ee08c07d7f4fd97d5b863e1d461f40e 100644 (file)
@@ -1,6 +1,7 @@
 " Test 'winfixbuf'
 
 source check.vim
+source shared.vim
 
 " Find the number of open windows in the current tab
 func s:get_windows_count()
@@ -3427,4 +3428,15 @@ func Test_bufdo_cnext_splitwin_fails()
   set winminheight&vim winheight&vim
 endfunc
 
+" Test that exiting with 'winfixbuf' and EXITFREE doesn't cause an error.
+func Test_exitfree_no_error()
+  let lines =<< trim END
+    set winfixbuf
+    qall!
+  END
+  call writefile(lines, 'Xwfb_exitfree', 'D')
+  call assert_notmatch('E1513:',
+        \ system(GetVimCommandClean() .. ' -X -S Xwfb_exitfree'))
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 46dd27331a8cfa8d36cd3361a86ecf271ce08102..3067d75f947c2c87a1c1bd6aae8bf6f2aea57f50 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    216,
 /**/
     215,
 /**/