Skip to content

Commit a4e6c42

Browse files
committed
feat: Add action when click on branch
1 parent 4fa8190 commit a4e6c42

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

jcs-modeline.el

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
(declare-function flycheck-has-current-errors-p "ext:flycheck.el")
110110
(declare-function flycheck-count-errors "ext:flycheck.el")
111111

112+
(declare-function magit-branch "ext:magit-branch.el")
113+
112114
;;
113115
;; (@* "Entry" )
114116
;;
@@ -463,13 +465,21 @@ mouse-1: Switch project"
463465
(tip (jcs-modeline-2str backend)))
464466
(concat (propertize backend-icon
465467
'mouse-face 'mode-line-highlight
466-
'help-echo tip)
468+
'help-echo tip
469+
'local-map
470+
(let ((map (make-sparse-keymap)))
471+
(define-key map (vector 'mode-line 'mouse-1) #'magit-branch)
472+
map))
467473
(propertize (concat
468474
separator
469475
branch)
470476
'face 'jcs-modeline-vc-face
471477
'mouse-face 'mode-line-highlight
472-
'help-echo tip)
478+
'help-echo tip
479+
'local-map
480+
(let ((map (make-sparse-keymap)))
481+
(define-key map (vector 'mode-line 'mouse-1) #'magit-branch)
482+
map))
473483
" ")))
474484

475485
;;

0 commit comments

Comments
 (0)