1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Add 'always' parameter to autoopen()

This commit is contained in:
Jan Larres
2012-01-14 19:35:01 +13:00
parent 81cfb3f903
commit d48c6f83f5
2 changed files with 18 additions and 7 deletions

View File

@@ -3081,11 +3081,13 @@ endfunction
" Automatically open Tagbar if one of the open buffers contains a supported
" file
function! tagbar#autoopen()
function! tagbar#autoopen(...)
let always = a:0 > 0 ? a:1 : 1
call s:Init()
for bufnr in range(1, bufnr('$'))
if buflisted(bufnr)
if buflisted(bufnr) && (always || bufwinnr(bufnr) != -1)
let ftype = s:DetectFiletype(bufnr)
if s:IsValidFile(bufname(bufnr), ftype)
call s:OpenWindow('')