mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
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.
This commit is contained in:
@ -443,18 +443,21 @@ files, so this replace calls to `pp' with the much faster `prin1'."
|
|||||||
(apply fn args)))
|
(apply fn args)))
|
||||||
|
|
||||||
(defun doom-set-jump-maybe-a (fn &rest 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))
|
(let ((origin (point-marker))
|
||||||
(result
|
(result
|
||||||
(let* ((evil--jumps-jumping t)
|
(let* ((evil--jumps-jumping t)
|
||||||
(better-jumper--jumping t))
|
(better-jumper--jumping t))
|
||||||
(apply fn args))))
|
(apply fn args)))
|
||||||
(unless result
|
(dest (point-marker)))
|
||||||
|
(unless (equal origin dest)
|
||||||
(with-current-buffer (marker-buffer origin)
|
(with-current-buffer (marker-buffer origin)
|
||||||
(better-jumper-set-jump
|
(better-jumper-set-jump
|
||||||
(if (markerp (car args))
|
(if (markerp (car args))
|
||||||
(car args)
|
(car args)
|
||||||
origin))))
|
origin))))
|
||||||
|
(set-marker origin nil)
|
||||||
|
(set-marker dest nil)
|
||||||
result))
|
result))
|
||||||
|
|
||||||
(defun doom-set-jump-h ()
|
(defun doom-set-jump-h ()
|
||||||
|
Reference in New Issue
Block a user