Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lispyville.el
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ on outlines. Unlike `up-list', it will keep the point on the closing delimiter."

(evil-define-motion lispyville-forward-atom-begin (count)
"Go to the next atom or comment beginning COUNT times."
:type exclusive
(or count (setq count 1))
(if (< count 0)
(lispyville-backward-atom-begin (- count))
Expand All @@ -844,6 +845,7 @@ on outlines. Unlike `up-list', it will keep the point on the closing delimiter."

(evil-define-motion lispyville-backward-atom-begin (count)
"Go to the previous atom or comment beginning COUNT times. "
:type exclusive
(or count (setq count 1))
(if (< count 0)
(lispyville-forward-atom-begin (- count))
Expand All @@ -857,7 +859,9 @@ on outlines. Unlike `up-list', it will keep the point on the closing delimiter."

(evil-define-motion lispyville-forward-atom-end (count)
"Go to the next atom or comment end COUNT times."
:type inclusive
(or count (setq count 1))
(forward-char 1)
(if (< count 0)
(lispyville-backward-atom-end (- count))
(cl-dotimes (_ count)
Expand All @@ -866,10 +870,12 @@ on outlines. Unlike `up-list', it will keep the point on the closing delimiter."
(unless (and (ignore-errors (end-of-thing 'lispyville-atom))
(not (<= (point) orig-pos)))
(goto-char orig-pos)
(cl-return))))))
(cl-return))))
(forward-char -1)))

(evil-define-motion lispyville-backward-atom-end (count)
"Go to the previous atom or comment end COUNT times."
:type inclusive
(or count (setq count 1))
(if (< count 0)
(lispyville-forward-atom-end (- count))
Expand All @@ -882,7 +888,8 @@ on outlines. Unlike `up-list', it will keep the point on the closing delimiter."
(unless (and (ignore-errors (end-of-thing 'lispyville-atom))
(not (>= (point) orig-pos)))
(goto-char orig-pos)
(cl-return))))))
(cl-return))))
(forward-char -1)))

(evil-define-motion lispyville-forward-atom (count)
"Move forward across an atom COUNT times"
Expand Down Expand Up @@ -1196,7 +1203,7 @@ Delete any nils from POSITIONS first."
(unless (bounds-of-thing-at-point 'defun)
(goto-char orig-pos)
(cl-return))))
(unless (= (point) (1+ orig-pos))
(unless (or (eobp) (= (point) (1+ orig-pos)))
(backward-char)))))
(put 'lispyville-function 'end-op #'lispyville-forward-function-end)

Expand Down