Skip to content

ge inner motion not working? #43

@citizenmatt

Description

@citizenmatt

Given a string like CamelCaseMot{caret}ion, and the text caret is at the position marker {caret}, then vi\w, vi\e and vi\b all have the same effect and select the Motion "word". But if I use vi\ge, then I get seM selected - CamelCa{selstart}seM{selend}otion.

I don't know what the behaviour of vi\ge should be. The difference between the other inner motion actions only seems to be obvious with snake or kebab case, or at the end of an identifier.

  • vi\w will include trailing underscores, or the trailing space at the end of an identifier.
  • vi\e doesn't include any trailing characters, matching only to the end of the current word.
  • vi\b selects to the start of the current word segment or the start of the identifier if on the first word segment, not including trailing spaces.

So it seems that vi\ge should mirror vi\w behaviour and select the current word and any leading spaces/underscores/separators, up to but not including the end of the previous word segment.

Is this right? It appears to match what \ge is doing - selecting leading spaces/separators. So it would seem that it should do \ge v e. Or, depending on the direction of the selection range, e v \ge (but then that would imply that vi\b should actually be e v b).

What should vi\ge do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions