mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0688: cannot resize the window in a FileType autocommand
Problem: Cannot resize the window in a FileType autocommand. (Ingo Karkat)
Solution: Add the CMDWIN flag to :resize. (test by Ingo Karkat,
closes vim/vim#1804)
9c4fefffb6
This commit is contained in:
parent
bfe029a11d
commit
33eb5833b2
@ -2158,7 +2158,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='resize',
|
command='resize',
|
||||||
flags=bit.bor(RANGE, NOTADR, TRLBAR, WORD1),
|
flags=bit.bor(RANGE, NOTADR, TRLBAR, WORD1, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_resize',
|
func='ex_resize',
|
||||||
},
|
},
|
||||||
|
@ -59,7 +59,9 @@
|
|||||||
#define BUFUNL 0x20000 /* accepts unlisted buffer too */
|
#define BUFUNL 0x20000 /* accepts unlisted buffer too */
|
||||||
#define ARGOPT 0x40000 /* allow "++opt=val" argument */
|
#define ARGOPT 0x40000 /* allow "++opt=val" argument */
|
||||||
#define SBOXOK 0x80000 /* allowed in the sandbox */
|
#define SBOXOK 0x80000 /* allowed in the sandbox */
|
||||||
#define CMDWIN 0x100000 /* allowed in cmdline window */
|
#define CMDWIN 0x100000 /* allowed in cmdline window; when missing
|
||||||
|
* disallows editing another buffer when
|
||||||
|
* curbuf_lock is set */
|
||||||
#define MODIFY 0x200000 /* forbidden in non-'modifiable' buffer */
|
#define MODIFY 0x200000 /* forbidden in non-'modifiable' buffer */
|
||||||
#define EXFLAGS 0x400000 /* allow flags after count in argument */
|
#define EXFLAGS 0x400000 /* allow flags after count in argument */
|
||||||
#define FILES (XFILE | EXTRA) /* multiple extra files allowed */
|
#define FILES (XFILE | EXTRA) /* multiple extra files allowed */
|
||||||
|
@ -2169,18 +2169,6 @@ func Test_bufoverflow()
|
|||||||
set efm&vim
|
set efm&vim
|
||||||
endfunc
|
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
|
" Tests for getting the quickfix stack size
|
||||||
func XsizeTests(cchar)
|
func XsizeTests(cchar)
|
||||||
call s:setup_commands(a:cchar)
|
call s:setup_commands(a:cchar)
|
||||||
@ -2210,6 +2198,18 @@ func Test_Qf_Size()
|
|||||||
call XsizeTests('l')
|
call XsizeTests('l')
|
||||||
endfunc
|
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()
|
func Test_cclose_in_autocmd()
|
||||||
" Problem is only triggered if "starting" is zero, so that the OptionsSet
|
" Problem is only triggered if "starting" is zero, so that the OptionsSet
|
||||||
" event will be triggered.
|
" event will be triggered.
|
||||||
@ -2225,3 +2225,20 @@ func Test_cclose_in_autocmd()
|
|||||||
augroup! QF_Test
|
augroup! QF_Test
|
||||||
" call test_override('starting', 0)
|
" call test_override('starting', 0)
|
||||||
endfunc
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user