Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ge inner motion not working? #43

Open
citizenmatt opened this issue Jul 31, 2020 · 1 comment
Open

ge inner motion not working? #43

citizenmatt opened this issue Jul 31, 2020 · 1 comment

Comments

@citizenmatt
Copy link

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?

@bkad
Copy link
Owner

bkad commented Aug 3, 2020

I think it would make sense that it would select the leading separators between words. If there were no separators, then would the selection be empty? I think that would be consistent but perhaps surprising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants