Skip to content

Commit 6fc9d8d

Browse files
committed
Push to jump list by default for unscoped motions, closes #29
1 parent 88c0bf0 commit 6fc9d8d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ If `expr` is non-`nil`, the motion will be executed in all visible windows simul
9393

9494
When specified, `(goto-char (funcall callable))` is run before the motion is executed. For example, use this to jump to the BOL of each line as in easymotion with `:initial-position #'point-at-bol`. Unlike in `:pre-hook`, `callable` is run once per window when `:all-windows` is specified.
9595

96+
* `:push-jump expr`
97+
98+
When `expr` is non-`nil`, the motion will push to the `evil` jump list before jumping. This defaults to `t` when the motion is un`:scope`ed.
99+
96100
* `:collect-postprocess callable`
97101

98102
When specified, `callable` is called on the collected list of points (which is of the form `((point window)...)`). Otherwise, the default function, which sorts the points in order of increasing distance from `(point)`, is used.

evil-easymotion.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
scope
179179
all-windows
180180
initial-point
181+
push-jump
181182
collect-postprocess)
182183
"Automatically define an evil easymotion for `func', naming it `name'"
183184
`(,(if all-windows
@@ -189,6 +190,8 @@
189190
(evil-without-repeat
190191
,(evilem--compute-inclusivity funcs)
191192
(cl-letf* ,bind
193+
,(when (or push-jump (not scope))
194+
'(evil--jumps-push))
192195
,(when pre-hook `(funcall ,(if (functionp pre-hook)
193196
pre-hook
194197
`(lambda () ,pre-hook))))
@@ -238,6 +241,7 @@
238241
scope
239242
all-windows
240243
initial-point
244+
push-jump
241245
collect-postprocess)
242246
`(evilem-make-motion
243247
,(or (evilem--unquote name)
@@ -249,6 +253,7 @@
249253
:scope ,scope
250254
:all-windows ,all-windows
251255
:initial-point ,initial-point
256+
:push-jump ,push-jump
252257
:collect-postprocess ,collect-postprocess))
253258

254259
(cl-defmacro evilem-create-plain (motions
@@ -283,6 +288,7 @@
283288
scope
284289
all-windows
285290
initial-point
291+
push-jump
286292
collect-postprocess)
287293
"Automatically create and bind an evil motion"
288294
`(define-key ,(if all-windows
@@ -297,6 +303,7 @@
297303
:scope ,scope
298304
:all-windows ,all-windows
299305
:initial-point ,initial-point
306+
:push-jump ,push-jump
300307
:collect-postprocess ,collect-postprocess)))
301308

302309
;;;###autoload

0 commit comments

Comments
 (0)