Просмотр исходного кода

Test `&buftype == 'terminal'` to detect a terminal buffer.

The `term://` prefix on the buffer name is Neovim-specific, but the
check of `&buftype` works for both Vim and Neovim.
Michael Henry 10 месяцев назад
Родитель
Сommit
948e1b7b1e
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      plugin/bufexplorer.vim

+ 2 - 1
plugin/bufexplorer.vim

@@ -709,8 +709,9 @@ function! s:GetBufferInfo(bufnr)
             let name = "[No Name]"
         endif
 
+        let b.isterminal = getbufvar(b._bufnr, '&buftype') == 'terminal'
         " Filter out term:// buffers if g:bufExplorerShowTerminal is 0.
-        if !g:bufExplorerShowTerminal && name =~ '^term://'
+        if !g:bufExplorerShowTerminal && b.isterminal
             continue
         endif