Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong type error in lsp-ui-imenu--view #753

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lsp-ui-imenu.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down