|
163 | 163 | #'evilem--default-collect-postprocess)
|
164 | 164 | points)))
|
165 | 165 |
|
| 166 | +(defun evilem--compute-inclusivity (funcs) |
| 167 | + (when (and (= (length funcs) 1) |
| 168 | + (evil-has-command-properties-p (car funcs))) |
| 169 | + `(setq evil-this-type |
| 170 | + ',(evil-get-command-property (car funcs) :type)))) |
| 171 | + |
166 | 172 | (cl-defmacro evilem-make-motion (name
|
167 | 173 | funcs
|
168 | 174 | &key
|
|
181 | 187 | (require 'avy)
|
182 | 188 | (avy-with ,name
|
183 | 189 | (evil-without-repeat
|
184 |
| - (setq evil-this-type 'inclusive) |
| 190 | + ,(evilem--compute-inclusivity funcs) |
185 | 191 | (cl-letf* ,bind
|
186 | 192 | ,(when pre-hook `(funcall ,(if (functionp pre-hook)
|
187 | 193 | pre-hook
|
|
337 | 343 | (evilem-define (kbd (concat prefix " t")) #'evil-repeat-find-char
|
338 | 344 | :name 'evilem--motion-evil-find-char-to
|
339 | 345 | :pre-hook (save-excursion
|
| 346 | + (setq evil-this-type 'inclusive) |
340 | 347 | (call-interactively #'evil-find-char-to))
|
341 | 348 | :bind ((evil-cross-lines t)))
|
342 | 349 |
|
343 | 350 | (evilem-define (kbd (concat prefix " T")) #'evil-repeat-find-char
|
344 | 351 | :name 'evilem--motion-evil-find-char-to-backward
|
345 | 352 | :pre-hook (save-excursion
|
| 353 | + (setq evil-this-type 'exclusive) |
346 | 354 | (call-interactively #'evil-find-char-to-backward))
|
347 | 355 | :bind ((evil-cross-lines t)))
|
348 | 356 |
|
349 | 357 | (evilem-define (kbd (concat prefix " f")) #'evil-repeat-find-char
|
350 | 358 | :name 'evilem--motion-evil-find-char
|
351 | 359 | :pre-hook (save-excursion
|
| 360 | + (setq evil-this-type 'inclusive) |
352 | 361 | (call-interactively #'evil-find-char))
|
353 | 362 | :bind ((evil-cross-lines t)))
|
354 | 363 |
|
355 | 364 | (evilem-define (kbd (concat prefix " F")) #'evil-repeat-find-char
|
356 | 365 | :name 'evilem--motion-evil-find-char-backward
|
357 | 366 | :pre-hook (save-excursion
|
| 367 | + (setq evil-this-type 'exclusive) |
358 | 368 | (call-interactively #'evil-find-char-backward))
|
359 | 369 | :bind ((evil-cross-lines t)))
|
360 | 370 |
|
|
0 commit comments