Skip to content

Commit

Permalink
refactor: simplify the vi-jump-back adn vi-jump-next, and document it.
Browse files Browse the repository at this point in the history
  • Loading branch information
sakurawald committed Dec 9, 2024
1 parent 11c26e4 commit 806461c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions extensions/vi-mode/commands.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,13 +1031,12 @@ on the same line or at eol if there are none."

(define-command vi-jump-back (&optional (n 1)) (:universal)
(dotimes (i n)
(let ((target-point (jump-back)))
(recenter-line-if-point-not-inside-window target-point))))
;; The return value of jump-back is target jump point.
(recenter-line-if-point-not-inside-window (jump-back))))

(define-command vi-jump-next (&optional (n 1)) (:universal)
(dotimes (i n)
(let ((target-point (jump-next)))
(recenter-line-if-point-not-inside-window target-point))))
(recenter-line-if-point-not-inside-window (jump-next))))

(define-motion vi-jump-previous () ()
(:jump t)
Expand Down

0 comments on commit 806461c

Please sign in to comment.