|
125 | 125 | all-windows
|
126 | 126 | initial-point
|
127 | 127 | sort-key
|
128 |
| - collect-postprocess) |
| 128 | + collect-postprocess |
| 129 | + include-invisible) |
129 | 130 | "Repeatedly execute func, and collect the cursor positions into a list"
|
130 | 131 | (cl-letf ((points nil)
|
131 | 132 | (point nil)
|
|
156 | 157 | (setq this-command func
|
157 | 158 | last-command func)
|
158 | 159 | (call-interactively func)
|
| 160 | + (unless include-invisible |
| 161 | + (let ((ov (car (overlays-at (point))))) |
| 162 | + (while (and ov (member |
| 163 | + 'invisible |
| 164 | + (overlay-properties ov))) |
| 165 | + (goto-char (overlay-end ov)) |
| 166 | + ;; This is a bit of a hack, since we |
| 167 | + ;; can't guarantee that we will end |
| 168 | + ;; up at the same point if we start |
| 169 | + ;; at the end of the invisible |
| 170 | + ;; region vs. looping through it. |
| 171 | + (call-interactively func) |
| 172 | + (setq ov (car (overlays-at (point))))))) |
159 | 173 | t)
|
160 | 174 | (setq point (cons (point) (get-buffer-window)))
|
161 | 175 | (not (member point points))
|
|
185 | 199 | all-windows
|
186 | 200 | initial-point
|
187 | 201 | push-jump
|
188 |
| - collect-postprocess) |
| 202 | + collect-postprocess |
| 203 | + include-invisible) |
189 | 204 | "Automatically define an evil easymotion for `func', naming it `name'"
|
190 | 205 | `(,(if all-windows
|
191 | 206 | 'evil-define-command
|
|
205 | 220 | ,scope
|
206 | 221 | ,all-windows
|
207 | 222 | ,initial-point
|
208 |
| - ,collect-postprocess)) |
| 223 | + ,collect-postprocess |
| 224 | + ,include-invisible)) |
209 | 225 | ,(when post-hook `(funcall ,(if (functionp post-hook)
|
210 | 226 | post-hook
|
211 | 227 | `(lambda () ,post-hook)))))))))
|
|
219 | 235 | scope
|
220 | 236 | all-windows
|
221 | 237 | initial-point
|
222 |
| - collect-postprocess) |
| 238 | + collect-postprocess |
| 239 | + include-invisible) |
223 | 240 | "Automatically define a plain easymotion for `func', naming it `name'"
|
224 | 241 | `(defun ,name ()
|
225 | 242 | (interactive)
|
|
233 | 250 | ,scope
|
234 | 251 | ,all-windows
|
235 | 252 | ,initial-point
|
236 |
| - ,collect-postprocess)) |
| 253 | + ,collect-postprocess |
| 254 | + ,include-invisible)) |
237 | 255 | ,(when post-hook `(funcall ,(if (functionp post-hook)
|
238 | 256 | post-hook
|
239 | 257 | `(lambda () ,post-hook))))))))
|
|
248 | 266 | all-windows
|
249 | 267 | initial-point
|
250 | 268 | push-jump
|
251 |
| - collect-postprocess) |
| 269 | + collect-postprocess |
| 270 | + include-invisible) |
252 | 271 | `(evilem-make-motion
|
253 | 272 | ,(or (evilem--unquote name)
|
254 | 273 | (intern (evilem--make-name motions)))
|
|
260 | 279 | :all-windows ,all-windows
|
261 | 280 | :initial-point ,initial-point
|
262 | 281 | :push-jump ,push-jump
|
263 |
| - :collect-postprocess ,collect-postprocess)) |
| 282 | + :collect-postprocess ,collect-postprocess |
| 283 | + :include-invisible ,include-invisible)) |
264 | 284 |
|
265 | 285 | (cl-defmacro evilem-create-plain (motions
|
266 | 286 | &key
|
|
271 | 291 | scope
|
272 | 292 | all-windows
|
273 | 293 | initial-point
|
274 |
| - collect-postprocess) |
| 294 | + collect-postprocess |
| 295 | + include-invisible) |
275 | 296 | `(evilem-make-motion-plain
|
276 | 297 | ,(or (evilem--unquote name)
|
277 | 298 | (intern (evilem--make-name motions)))
|
|
282 | 303 | :scope ,scope
|
283 | 304 | :all-windows ,all-windows
|
284 | 305 | :initial-point ,initial-point
|
285 |
| - :collect-postprocess ,collect-postprocess)) |
| 306 | + :collect-postprocess ,collect-postprocess |
| 307 | + :include-invisible ,include-invisible)) |
286 | 308 |
|
287 | 309 | (cl-defmacro evilem-define (key
|
288 | 310 | motions
|
|
295 | 317 | all-windows
|
296 | 318 | initial-point
|
297 | 319 | push-jump
|
298 |
| - collect-postprocess) |
| 320 | + collect-postprocess |
| 321 | + include-invisible) |
299 | 322 | "Automatically create and bind an evil motion"
|
300 | 323 | `(define-key ,(if all-windows
|
301 | 324 | 'evil-normal-state-map
|
|
310 | 333 | :all-windows ,all-windows
|
311 | 334 | :initial-point ,initial-point
|
312 | 335 | :push-jump ,push-jump
|
313 |
| - :collect-postprocess ,collect-postprocess))) |
| 336 | + :collect-postprocess ,collect-postprocess |
| 337 | + :include-invisible ,include-invisible))) |
314 | 338 |
|
315 | 339 | ;;;###autoload (autoload 'evilem-motion-forward-word-begin "evil-easymotion" nil t)
|
316 | 340 | (evilem-make-motion
|
|
0 commit comments