From 395de90ce0cd06d058b753f4269c9077ccf1f11b Mon Sep 17 00:00:00 2001 From: stskyblade Date: Mon, 26 Jun 2023 20:50:28 +0800 Subject: [PATCH] Fix wrong type error in lsp-ui-imenu--view --- lsp-ui-imenu.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lsp-ui-imenu.el b/lsp-ui-imenu.el index 3cb1e515..4aee85fb 100644 --- a/lsp-ui-imenu.el +++ b/lsp-ui-imenu.el @@ -356,16 +356,23 @@ ITEMS are used when the kind position is 'left." (while (not (= (get-text-property (point) 'index) 0)) (forward-line -1))) +(defun lsp-ui-imenu--position-at-point nil + ;; `semantic-create-imenu-index' uses overlays as position paramters. + (let ((marker (get-text-property (point) 'marker))) + (if (overlayp marker) + (setq marker (overlay-start marker))) + marker)) + (defun lsp-ui-imenu--visit nil (interactive) - (let ((marker (get-text-property (point) 'marker))) + (let ((marker (lsp-ui-imenu--position-at-point))) (select-window (get-buffer-window lsp-ui-imenu--origin)) (goto-char marker) (pulse-momentary-highlight-one-line (point) 'next-error))) (defun lsp-ui-imenu--view nil (interactive) - (let ((marker (get-text-property (point) 'marker))) + (let ((marker (lsp-ui-imenu--position-at-point))) (with-selected-window (get-buffer-window lsp-ui-imenu--origin) (goto-char marker) (recenter)