From 5e25794d4b2f89b3c34da77bd25a17f33914f1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Wi=C4=99cek?= Date: Tue, 25 Feb 2014 22:36:36 +0100 Subject: [PATCH 1/2] Correctly detect mercurial repos using lawrencium --- autoload/airline/extensions/branch.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index 82fd139..c0f63db 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -55,7 +55,7 @@ endfunction function! s:check_in_path() if !exists('b:airline_branch_path') let root = get(b:, 'git_dir', get(b:, 'mercurial_dir', '')) - let bufferpath = resolve(fnamemodify(expand('%'), ':p:h')) + let bufferpath = resolve(fnamemodify(expand('%'), ':p')) if !filereadable(root) "not a file " if .git is a directory, it's the old submodule format From 63f811e15c5d31929c467a64edef8cc5e0ee9112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Wi=C4=99cek?= Date: Tue, 25 Feb 2014 22:43:19 +0100 Subject: [PATCH 2/2] Enable branch extension when vcscommand is available --- autoload/airline/extensions.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index f32abd3..e41e5ea 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -168,7 +168,8 @@ function! airline#extensions#load() endif if (get(g:, 'airline#extensions#branch#enabled', 1) && get(g:, 'airline_enable_branch', 1)) - \ && (exists('*fugitive#head') || exists('*lawrencium#statusline')) + \ && (exists('*fugitive#head') || exists('*lawrencium#statusline') || + \ (get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine'))) call airline#extensions#branch#init(s:ext) endif