From bb89a7a4971967c70c039110f50452a48aaa693d Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 19 Sep 2021 07:52:53 -0400 Subject: [PATCH] Invert flag for lazy initialization I think this second argument might become an optional buffer number at some point, so change the special value for lazy to an invalid buffer number. --- plugin/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index b51aa35..7fce4b8 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -420,7 +420,7 @@ function! FugitiveDetect(...) abort if exists('b:git_dir') && b:git_dir =~# '^$\|' . s:bad_git_dir unlet b:git_dir endif - if a:0 > 1 && a:2 && !exists('#User#Fugitive') + if a:0 > 1 && a:2 is# 0 && !exists('#User#Fugitive') return '' endif if !exists('b:git_dir') @@ -604,7 +604,7 @@ augroup fugitive autocmd! autocmd BufNewFile,BufReadPost * - \ call FugitiveDetect(expand(':p'), 1) + \ call FugitiveDetect(expand(':p'), 0) autocmd FileType netrw call FugitiveDetect(fnamemodify(get(b:, 'netrw_curdir', expand(':p')), ':p'), 1) autocmd FileType git