From 0e8af0e6d2b4740c47d31784410c6381e113b5bc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 Feb 2019 00:53:03 -0500 Subject: [PATCH] Integrate evil jumplist into xref #1161 Rather than use xref-pop-marker-stack, evil users can now use the jumplist to jump from and to xref calls (with C-o/C-i). --- modules/feature/evil/config.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/feature/evil/config.el b/modules/feature/evil/config.el index f88fa1a86..72ce0b371 100644 --- a/modules/feature/evil/config.el +++ b/modules/feature/evil/config.el @@ -128,13 +128,15 @@ line with a linewise comment.") (advice-add #'evil-window-split :override #'+evil*window-split) (advice-add #'evil-window-vsplit :override #'+evil*window-vsplit) + ;; Integrate evil's jump-list into some navigational commands (defun +evil*set-jump (orig-fn &rest args) "Set a jump point and ensure ORIG-FN doesn't set any new jump points." - (evil-set-jump) + (evil-set-jump (if (markerp (car args)) (car args))) (let ((evil--jumps-jumping t)) (apply orig-fn args))) (advice-add #'counsel-git-grep-action :around #'+evil*set-jump) (advice-add #'helm-ag--find-file-action :around #'+evil*set-jump) + (advice-add #'xref-push-marker-stack :around #'+evil*set-jump) ;; In evil, registers 2-9 are buffer-local. In vim, they're global, so... (defun +evil*make-numbered-markers-global (orig-fn char)