]> granicus.if.org Git - vim/commitdiff
patch 8.0.0688: cannot resize the window in a FileType autocommand v8.0.0688
authorBram Moolenaar <Bram@vim.org>
Wed, 28 Jun 2017 20:26:54 +0000 (22:26 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 28 Jun 2017 20:26:54 +0000 (22:26 +0200)
Problem:    Cannot resize the window in a FileType autocommand. (Ingo Karkat)
Solution:   Add the CMDWIN flag to :resize. (test by Ingo Karkat,
            closes #1804)

src/ex_cmds.h
src/testdir/test_quickfix.vim
src/version.c

index 519cd0811edc2eb10f566094c829a1b97d383c00..02d5690dcc61e718e0233146ffbee04762defb68 100644 (file)
@@ -51,7 +51,9 @@
 #define BUFUNL       0x20000L  /* accepts unlisted buffer too */
 #define ARGOPT       0x40000L  /* allow "++opt=val" argument */
 #define SBOXOK       0x80000L  /* allowed in the sandbox */
-#define CMDWIN      0x100000L  /* allowed in cmdline window */
+#define CMDWIN      0x100000L  /* allowed in cmdline window; when missing
+                                * disallows editing another buffer when
+                                * curbuf_lock is set */
 #define MODIFY       0x200000L /* forbidden in non-'modifiable' buffer */
 #define EXFLAGS      0x400000L /* allow flags after count in argument */
 #define FILES  (XFILE | EXTRA) /* multiple extra files allowed */
@@ -1176,7 +1178,7 @@ EX(CMD_registers, "registers",    ex_display,
                        EXTRA|NOTRLCOM|TRLBAR|CMDWIN,
                        ADDR_LINES),
 EX(CMD_resize,         "resize",       ex_resize,
-                       RANGE|NOTADR|TRLBAR|WORD1,
+                       RANGE|NOTADR|TRLBAR|WORD1|CMDWIN,
                        ADDR_LINES),
 EX(CMD_retab,          "retab",        ex_retab,
                        TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY,
index c5954585c02276d12b784b27b24c9656ee89d50f..b3cc6891a53216fc1ecfa6240742417ea32abef7 100644 (file)
@@ -2190,18 +2190,6 @@ func Test_bufoverflow()
   set efm&vim
 endfunc
 
-func Test_cclose_from_copen()
-    augroup QF_Test
-       au!
-        au FileType qf :call assert_fails(':cclose', 'E788')
-    augroup END
-    copen
-    augroup QF_Test
-       au!
-    augroup END
-    augroup! QF_Test
-endfunc
-
 " Tests for getting the quickfix stack size
 func XsizeTests(cchar)
   call s:setup_commands(a:cchar)
@@ -2231,6 +2219,18 @@ func Test_Qf_Size()
   call XsizeTests('l')
 endfunc
 
+func Test_cclose_from_copen()
+    augroup QF_Test
+       au!
+        au FileType qf :call assert_fails(':cclose', 'E788')
+    augroup END
+    copen
+    augroup QF_Test
+       au!
+    augroup END
+    augroup! QF_Test
+endfunc
+
 func Test_cclose_in_autocmd()
   " Problem is only triggered if "starting" is zero, so that the OptionsSet
   " event will be triggered.
@@ -2246,3 +2246,20 @@ func Test_cclose_in_autocmd()
   augroup! QF_Test
   call test_override('starting', 0)
 endfunc
+
+func Test_resize_from_copen()
+    augroup QF_Test
+       au!
+        au FileType qf resize 5
+    augroup END
+    try
+       " This should succeed without any exception.  No other buffers are
+       " involved in the autocmd.
+       copen
+    finally
+       augroup QF_Test
+           au!
+       augroup END
+       augroup! QF_Test
+    endtry
+endfunc
index 9f2515d563f3a0d755b7daa0b7fd93f47613f162..7bf3f4e9c68f2580d077f91a52bc8d5b984e303f 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    688,
 /**/
     687,
 /**/