Skip to content

Commit 11a3a65

Browse files
DivvyCrbrotzeit
authored andcommitted
More rigorous fix, as per Issue emacs-lsp#474.
1 parent 84e592e commit 11a3a65

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lsp-ui-imenu.el

+9-4
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@
183183

184184
(defun lsp-ui-imenu--put-separator nil
185185
(let ((ov (make-overlay (point) (point))))
186-
(overlay-put ov 'after-string (propertize "\n" 'face '(:height 0.6)))))
186+
(overlay-put ov 'after-string (propertize "\n" 'face '(:height 0.6)))
187+
(overlay-put ov 'priority 0)))
188+
189+
(defvar-local overlay-priority 0)
187190

188191
(defun lsp-ui-imenu--put-toplevel-title (title color-index)
189192
(if (eq lsp-ui-imenu-kind-position 'top)
@@ -194,18 +197,20 @@
194197
(concat (propertize "\n" 'face '(:height 0.6))
195198
(propertize title 'face `(:foreground ,color))
196199
"\n"
197-
(propertize "\n" 'face '(:height 0.6)))))
200+
(propertize "\n" 'face '(:height 0.6))))
201+
(overlay-put ov 'priority (setq overlay-priority (1- overlay-priority))))
198202
;; Left placement, title is put with the first sub item. Only put a separator here.
199203
(lsp-ui-imenu--put-separator)))
200204

201205
(defun lsp-ui-imenu--put-subtitle (title padding bars depth color-index is-last)
202206
(let ((ov (make-overlay (point) (point)))
203207
(title-color (lsp-ui-imenu--get-color (+ color-index depth))))
204208
(overlay-put
205-
ov 'before-string
209+
ov 'after-string
206210
(concat (lsp-ui-imenu--pad " " padding bars depth color-index t is-last)
207211
(propertize title 'face `(:foreground ,title-color))
208-
(propertize "\n" 'face '(:height 1))))))
212+
(propertize "\n" 'face '(:height 1))))
213+
(overlay-put ov 'priority (setq overlay-priority (1- overlay-priority)))))
209214

210215
(defun lsp-ui-imenu--insert-items (title items padding bars depth color-index)
211216
"Insert ITEMS for TITLE.

0 commit comments

Comments
 (0)