Function: doom-modeline-segment--vcs

doom-modeline-segment--vcs is a natively compiled function defined in doom-modeline-segments.el.

Signature

(doom-modeline-segment--vcs)

Documentation

Displays the current branch, colored based on its state.

Source Code

;; Defined in /nix/store/1lcicrdd2r4b8rkc91nnn74ymk1jl6yd-emacs-packages-deps/share/emacs/site-lisp/elpa/doom-modeline-20260928.1632/doom-modeline-segments.el
(doom-modeline-def-segment vcs
  "Displays the current branch, colored based on its state."
  (when doom-modeline--vcs
    (let-alist doom-modeline--vcs
      (let ((sep (doom-modeline-spc))
            (vsep (doom-modeline-vspc))
            (worktree-indicator (when doom-modeline--in-git-worktree-p
                                  (doom-modeline-vcs-icon "nf-cod-worktree" "⑆" "WT"
                                                          'doom-modeline-warning
                                                          'codicon))))
        (concat sep
                (propertize (concat
                             (doom-modeline-display-icon .icon)
                             (when worktree-indicator
                               (concat vsep worktree-indicator))
                             (unless doom-modeline--limited-width-p
                               (concat
                                vsep
                                (doom-modeline-display-text .text))))
                            'help-echo (get-text-property 1 'help-echo vc-mode)
                            'mouse-face 'doom-modeline-highlight
                            'local-map (get-text-property 1 'local-map vc-mode))
                sep)))))