From a3b074004edc0c421f3c73f967a29050b9c3bd41 Mon Sep 17 00:00:00 2001 From: Roy Chen Date: Wed, 29 Nov 2017 23:23:05 +0800 Subject: [PATCH] Show current branch name when magit is available --- powerline.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/powerline.el b/powerline.el index aa22194..b52e98b 100644 --- a/powerline.el +++ b/powerline.el @@ -487,9 +487,11 @@ static char * %s[] = { (when (and (buffer-file-name (current-buffer)) vc-mode) (if (and window-system (not powerline-gui-use-vcs-glyph)) (format-mode-line '(vc-mode vc-mode)) - (format " %s%s" + (format " %s %s" (char-to-string #xe0a0) - (format-mode-line '(vc-mode vc-mode)))))) + (if (featurep 'magit) + (magit-get-current-branch) + (format-mode-line '(vc-mode vc-mode))))))) ;;;###autoload (autoload 'powerline-encoding "powerline") (defpowerline powerline-encoding