From 00b7e390d35e14f87cb4b29c905e1cb228fd9446 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 9 Feb 2022 20:15:55 +0100 Subject: [PATCH] refactor!(lib): change condition for doom-set-jump-maybe-a BREAKING CHANGE: doom-set-jump-maybe-a would formerly set a jump point if FN returns non-nil. That condition was changed to: if the current buffer or cursor position have changed after FN. --- core/core-editor.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index 6b6c19fed..9985b052f 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -443,18 +443,21 @@ files, so this replace calls to `pp' with the much faster `prin1'." (apply fn args))) (defun doom-set-jump-maybe-a (fn &rest args) - "Set a jump point if fn returns non-nil." + "Set a jump point if fn actually moves the point." (let ((origin (point-marker)) (result (let* ((evil--jumps-jumping t) (better-jumper--jumping t)) - (apply fn args)))) - (unless result + (apply fn args))) + (dest (point-marker))) + (unless (equal origin dest) (with-current-buffer (marker-buffer origin) (better-jumper-set-jump (if (markerp (car args)) (car args) origin)))) + (set-marker origin nil) + (set-marker dest nil) result)) (defun doom-set-jump-h ()