From 8023f6f5dce09fa8f94e6a8bcdc1c6ad568a703d Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 11 Feb 2016 22:44:12 +0100 Subject: [PATCH 1/2] Add mq patch to branch output --- autoload/airline/extensions/branch.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index d7f227d..abda078 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -102,6 +102,11 @@ endfunction function! s:get_hg_branch() if s:has_lawrencium + let mq=system('hg qtop') + if v:shell_error==0 + let mq=matchstr(mq, '.*\ze\n') + return lawrencium#statusline(). '/'. mq + endif return lawrencium#statusline() endif return '' From da78d4a7bb18b724f6061150bb7e9f3fd380dfff Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 14 Feb 2016 17:05:53 +0100 Subject: [PATCH 2/2] Only show hg qtop output, if branch is also shown --- autoload/airline/extensions/branch.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index abda078..f1300b4 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -102,12 +102,13 @@ endfunction function! s:get_hg_branch() if s:has_lawrencium + let stl=lawrencium#statusline() let mq=system('hg qtop') - if v:shell_error==0 - let mq=matchstr(mq, '.*\ze\n') - return lawrencium#statusline(). '/'. mq + if v:shell_error==0 && !empty(stl) + let mq=matchstr(mq, '.*\ze\n') + return printf("%s/%s", stl, mq) endif - return lawrencium#statusline() + return stl endif return '' endfunction