Skip to content

Commit 9a79593

Browse files
authored
[breadcrumb] Set evil jumps when invoking lsp-breadcrumb-go-to-symbol (#2220)
1 parent 907dfe9 commit 9a79593

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lsp-headerline.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,15 @@ Switch to current mouse interacting window before doing BODY."
161161
directory-display-string)
162162
directory-display-string))
163163

164+
(declare-function evil-set-jump "ext:evil-jumps")
165+
164166
(lsp-defun lsp-headerline--symbol-with-action ((symbol &as &DocumentSymbol :name) symbol-display-string)
165167
"Build action for SYMBOL and SYMBOL-STRING."
166168
(lsp-headerline--with-action (let ((map (make-sparse-keymap)))
167169
(define-key map [header-line mouse-1]
168170
(lsp-headerline--make-mouse-handler
171+
(when (bound-and-true-p evil-mode)
172+
(evil-set-jump))
169173
(lsp-headerline--go-to-symbol symbol)))
170174
(define-key map [header-line mouse-2]
171175
(lsp-headerline--make-mouse-handler
@@ -335,6 +339,11 @@ PATH is the current folder to be checked."
335339
(lsp--info "Server does not support breadcrumb."))
336340
(lsp--info "Call this function with a number representing the symbol position on breadcrumb")))
337341

342+
(declare-function evil-set-command-property "ext:evil-common")
343+
344+
(with-eval-after-load 'evil
345+
(evil-set-command-property 'lsp-breadcrumb-go-to-symbol :jump t))
346+
338347
;;;###autoload
339348
(defun lsp-breadcrumb-narrow-to-symbol (symbol-position)
340349
"Narrow to the symbol range on breadcrumb at SYMBOL-POSITION."

0 commit comments

Comments
 (0)