From 67b43dc968fc1f4c8b23f91ad9000fae77bd1c34 Mon Sep 17 00:00:00 2001 From: Derek Schrock Date: Mon, 31 Jul 2023 14:23:41 -0400 Subject: [PATCH] Fix autocmd BufEnter by loading buffer after setting nofile For non-wilder vimrc that autocmd BufEnter (maybe more?) but opt to filter out based off buftype will try to operate on wilder's buffer during first open due to nofile being set after bufload. --- autoload/wilder/renderer/vim_api.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/wilder/renderer/vim_api.vim b/autoload/wilder/renderer/vim_api.vim index 946f74f..68a66b4 100644 --- a/autoload/wilder/renderer/vim_api.vim +++ b/autoload/wilder/renderer/vim_api.vim @@ -62,13 +62,14 @@ function! s:new_buf() abort set shortmess+=F let l:buf = bufadd('[Wilder Popup ' . s:index . ']') - call bufload(l:buf) call setbufvar(l:buf, '&buftype', 'nofile') call setbufvar(l:buf, '&bufhidden', 'hide') call setbufvar(l:buf, '&swapfile', 0) call setbufvar(l:buf, '&undolevels', -1) + call bufload(l:buf) + let &shortmess = l:old_shortmess let s:index += 1