mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
Merge pull request #20727 from zeertzjq/vim-9.0.0789
vim-patch:9.0.{0789,0790}
This commit is contained in:
@@ -1224,6 +1224,11 @@ int do_buffer(int action, int start, int dir, int count, int forceit)
|
|||||||
}
|
}
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
if ((action == DOBUF_GOTO || action == DOBUF_SPLIT) && (buf->b_flags & BF_DUMMY)) {
|
||||||
|
// disallow navigating to the dummy buffer
|
||||||
|
semsg(_(e_nobufnr), count);
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
// delete buffer "buf" from memory and/or the list
|
// delete buffer "buf" from memory and/or the list
|
||||||
if (unload) {
|
if (unload) {
|
||||||
|
@@ -3269,4 +3269,25 @@ func Test_noname_autocmd()
|
|||||||
augroup! test_noname_autocmd_group
|
augroup! test_noname_autocmd_group
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_autocmd_split_dummy()
|
||||||
|
" Autocommand trying to split a window containing a dummy buffer.
|
||||||
|
auto BufReadPre * exe "sbuf " .. expand("<abuf>")
|
||||||
|
" Avoid the "W11" prompt
|
||||||
|
au FileChangedShell * let v:fcs_choice = 'reload'
|
||||||
|
func Xautocmd_changelist()
|
||||||
|
cal writefile(['Xtestfile2:4:4'], 'Xerr')
|
||||||
|
edit Xerr
|
||||||
|
lex 'Xtestfile2:4:4'
|
||||||
|
endfunc
|
||||||
|
call Xautocmd_changelist()
|
||||||
|
" Should get E86, but it doesn't always happen (timing?)
|
||||||
|
silent! call Xautocmd_changelist()
|
||||||
|
|
||||||
|
au! BufReadPre
|
||||||
|
au! FileChangedShell
|
||||||
|
delfunc Xautocmd_changelist
|
||||||
|
bwipe! Xerr
|
||||||
|
call delete('Xerr')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user