Skip to content

Commit b2905ac

Browse files
authored
Fix lsp-headerline all-the-icons icons (#2233)
1 parent 43da111 commit b2905ac

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lsp-headerline.el

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,17 @@ caching purposes.")
7676

7777
(defun lsp-headerline--fix-image-background (image)
7878
"Fix IMAGE background if it is a file otherwise return as an icon."
79-
(if (and image (get-text-property 0 'display image))
80-
(propertize " " 'display
81-
(cl-list* 'image
82-
(plist-put
83-
(cl-copy-list
84-
(cl-rest (get-text-property
85-
0 'display
86-
image)))
87-
:background (face-attribute 'header-line :background))))
88-
(replace-regexp-in-string "\s\\|\t" "" (or image ""))))
79+
(if image
80+
(let ((display-image (get-text-property 0 'display image)))
81+
(if (listp display-image)
82+
(propertize " " 'display
83+
(cl-list* 'image
84+
(plist-put
85+
(cl-copy-list
86+
(cl-rest display-image))
87+
:background (face-attribute 'header-line :background))))
88+
(replace-regexp-in-string "\s\\|\t" "" display-image)))
89+
""))
8990

9091
(defun lsp-headerline--filename-with-icon (file-path)
9192
"Return the filename from FILE-PATH with the extension related icon."

0 commit comments

Comments
 (0)