Skip to content

Commit

Permalink
Use :universal-nil arg-descriptor when the default is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
naryl committed Oct 4, 2024
1 parent 1c624af commit 426573a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions extensions/vi-mode/commands.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,16 @@
(:type :line)
(previous-line n))

(define-motion vi-scroll-down (&optional (n nil)) (:universal)
(define-motion vi-scroll-down (&optional (n nil)) (:universal-nil)
(:type :inclusive :default-n-arg nil)
;; Somehow n is still 1 by default...
(when (eql n 1)
(unless n
(setf n (floor (window-height (current-window)) 2)))
(next-line n)
(scroll-down n))

(define-motion vi-scroll-up (&optional (n nil)) (:universal)
(define-motion vi-scroll-up (&optional (n nil)) (:universal-nil)
(:default-n-arg nil)
;; Somehow n is still 1 by default...
(when (eql n 1)
(unless n
(setf n (floor (window-height (current-window)) 2)))
(previous-line n)
(scroll-up n))
Expand Down

0 comments on commit 426573a

Please sign in to comment.