Alexander-Miller / treemacs

GNU General Public License v3.0
2.09k stars 153 forks source link

[UI] Add current workspace name to doom-modeline #1043

Closed sebastiaanspeck closed 1 year ago

sebastiaanspeck commented 1 year ago

Using the extra segment, the current workspace name will be shown on the doom-modeline. I have provided a screenshot to show how it looks. I have chosen for the minor-mode-face to make a difference between the major-mode (Treemacs) and the workspace name.

IMG_1037

sebastiaanspeck commented 1 year ago

This also fixes the next bug. A doom-modeline needs to define the LHS & RHS and currently treemacs only defines the LHS IMG_1052

Alexander-Miller commented 1 year ago

:+1:

sebastiaanspeck commented 1 year ago
((fboundp 'doom-modeline)
 (with-no-warnings
   (doom-modeline-def-segment treemacs
     "Display treemacs."
     (propertize (format " %s " (treemacs-workspace->name (treemacs-current-workspace)))
                 'face (doom-modeline-face 'doom-modeline-buffer-minor-mode)))
   (doom-modeline-def-modeline 'treemacs '(bar " " major-mode) '(treemacs))
   (doom-modeline 'treemacs)))