-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implemented sub-word cursor movement #2665
Conversation
Is there any news on this one? |
Cool, looks pretty good. Could you give a bit more detail about how subwords are determined? Is it via camel case, or symbols like numbers or I think the code needs be formatted by |
Good catch. I auto-formatted the modified files using According the determination of sub-words. I could not find a single spec of that. In general you can say it is a combination of camel case, snake case and pascal case, which I guess makes sense so sub-wording works for all languages. |
Any chance this is gonna make it into the next release? I would love to see this feature. |
I am reviewing PRs for the next release today and tomorrow -- I plan to merge this soon and include it in the next release. |
Its been a while and I kindly want to ask if there is any chance of getting this merged? |
Looks good to me. @JoeKar what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely 👍 for proposing this feature and thanks to you guys for taking care of creation and review.
I've just these two small remarks.
Currently I've unfortunately very limited time and wasn't able to test it yet, but was already in the situation to miss something like that. :)
…ordLeft and DeleteSubWordRight, DeleteSubWordLeft
…dLeft() and SubWordRight()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried...
- SubWordRight
- SubWordLeft
- SelectSubWordRight
- SelectSubWordLeft
- DeleteSubWordLeft
...and it matched the expectation. Furthermore I can't find a blocking point.
So, why not? :)
@dmaluka:
Shall we already merge it or schedule it after the next release?
I see no reason why not merge it now. |
Thanks again guys, for the review and your support. |
@masmu One thing I have noticed is that it is treating continuous space as a subword which is actually what I want for the word version as well. However, it seems like the subword doesn't work quite how I would expected it to be on lines with trailing spaces. Doing the reverse doesn't behave the same way, going from the end of the trailing spaces landed me at the beginning of the line with trailing spaces. Is this an expected behavior? |
Hey, thanks. And good catch!
Nope.
The line-break is suppose to act like as an additional jump position, right? I can confirm that this is not the case.
Can you please explain this a little bit more? |
Yes
Yeah, I am not a huge fan of how
So basically in normal
Doing a
However, if you have a word before multiple spaces, it stops at the multiple spaces, which is what I want but different from the behavior I said previously where it is treating spaces and a word together. So if you have
and do
The
which is exactly what I want from |
Micro has the |
Yes, I have it on already. But it is quite annoying if you want to delete continuous spaces with delete word and it deletes both the spaces and the word, |
I guess we should address the trailing spaces issue non the less. It is really confusing especially for standard users. Do I force push / update this PR? Or create another one? |
This one is already merged, so I guess you'd need to create another one anyway. |
Hello zyedidia,
I implemented the following bindable actions and would be happy about a merge:
SubWordRight
SubWordLeft
SelectSubWordRight
SelectSubWordLeft
DeleteSubWordRight
DeleteSubWordLeft
About the implementation:
internal/utils/utils.go
functions, but it should be fast.This branch resolves #1197
Keep up the amazing work!
Cheers