Skip to content

Commit

Permalink
Align nodes with no icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurnevsky committed Oct 1, 2023
1 parent 8b63636 commit 55edc90
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lsp-metals-treeview.el
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,16 @@ with values converted from json to hash tables."
;; UI tree view using treemacs
;;

(defun lsp-metals-treeview--xpm-pad (width)
"Return an XPM image with the specified WIDTH."
(format "/* XPM */
static char * pad_xpm[] = {
\"%d 1 1 1\",
\". c none\",
\"%s\"
};
" width (make-string width ?.)))

(defun lsp-metals-treeview--icon (metals-node open-form?)
"Return icon based on METALS-NODE.
The icon will depend on the individual METALS-NODE and whether the
Expand All @@ -566,7 +576,11 @@ do not show an icon."
lsp-treemacs-theme)

;; leaf node without an icon
" ")))
(concat (propertize " " 'display (create-image
(lsp-metals-treeview--xpm-pad treemacs--icon-size)
'xpm t
:mask 'heuristic))
" "))))

(defun lsp-metals-treeview--send-execute-command-async (command &optional args)
"Create and send a `workspace/executeCommand'.
Expand Down

0 comments on commit 55edc90

Please sign in to comment.