Fix: evilem motion forward word end stopping at single letters #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Couple of fixes:
call
evilem--compute-inclusivity
with the name of the function: fixes several evilem motions not respecting the inclusive/exclusive rules of the evil movementDuring the macro expantion of
the function quote argument becomes
(funcion . (evil-some-motion . nil))
This list was being passed to
evilem--compute-inclusivity
, which would try totake the first element and try to fetch the
:type property of the evil function effectively
evil-get-command-propertywith the symbol
'functioninstead of
'evil-some-motion`.This MR fixes the erroneous, keeping backwards compatibility in case
someone anywhere called (evilem--compute-inclusivity '(evil-some-motion))
make
{word,WORD}-end
movements see past single letters in operator-stateevilem-motion-forward-{word, WORD}-end
does not collect all targets when calledin operator-state due to a corner case in
evil-forward-word-end
: whencalled in operator-state, evil ensures the cursor does not move if it's over
a one-letter word.
As a result,
evilem--collect
's repeated calls to forward-word-end in operatorstate will stop at the first single-letter word inside the line.
For example,
g s e
will place targets on every word as expected:But when calling
evilem-motion-forward-word-end
during yank/delete/change, notargets will be created after "a", as
evilem--collect
stops afterevil-forward-word-end
refused to move the cursor in "a". For example, pressingy g s e
inthe example below will not place any target at "word" or any text afterwards:
This MR fixes this behavior by temporarily setting evil-state to 'motion
while collecting targets.