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

Keyboard navigation across word-boundaries doesn't feel right #3527

Closed
kumarharsh opened this issue Feb 27, 2016 · 6 comments
Closed

Keyboard navigation across word-boundaries doesn't feel right #3527

kumarharsh opened this issue Feb 27, 2016 · 6 comments
Assignees
Labels
verified Verification succeeded

Comments

@kumarharsh
Copy link
Contributor

Right now, the cursor in vscode jumps from the ending of one word to the ending of the next even when there are spaces and other characters between them.

Demo (with a pipe as my current cursor |, and repeated presses Ctrl+Right)

"|command": "actions.find"
"command|": "actions.find"
"command": "actions|.find"

Expected (sublimetext)

"|command": "actions.find"
"command|": "actions.find"
"command":| "actions.find"
"command": "actions|.find"

I think another related issue is that there is no setting in vscode (that I could find) of specifying the word separators (regex) such as in Sublime - or there should be a sub-word navigation option.

This was discussed here earlier: #3249

@alexdima
Copy link
Member

@kumarharsh Thank you for the feedback. In the upcoming 10.10, the word navigation has been refurbished and these will be the new stops for Ctrl+Right for your example:

|"command": "actions.find"
"|command": "actions.find"
"command|": "actions.find"
"command":| "actions.find"
"command": "|actions.find"
"command": "actions|.find"
"command": "actions.|find"
"command": "actions.find|"
"command": "actions.find"|

There will also be a new setting editor.wordSeparators where you can customize what a word is.

@alexdima alexdima added the verified Verification succeeded label Mar 21, 2016
@gordey4doronin
Copy link
Member

What about camel case?

|"commandCamelCase": "actions.find"
"|commandCamelCase": "actions.find"
"command|CamelCase": "actions.find"
"commandCamel|Case": "actions.find"
"commandCamelCase|": "actions.find"

@kumarharsh
Copy link
Contributor Author

@gordey4doronin that is subword navigation, which is being discussed in another issue.

@gordey4doronin
Copy link
Member

@kumarharsh Yes, I saw the issue #541

However.. I'm curious why we call it subword?

If we have something like this command-with-few-words, then it works fine.
It sees there are 4 word separated with - symbol which is taken from "editor.wordSeparators": "~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?".

And when we have commandWithFewWords, why it became subwords rather than words?
My expectation is vscode needs to understand that camel-case is also some kind of a word separator.

@alexandrudima What do you think?

@alexdima
Copy link
Member

alexdima commented Jun 17, 2016

You are correct, they are very similar in nature.

But technically, one is called word navigation (as it involves separator characters between groups of characters that become a word, so command-with-few-words is a group of characters containing 4 words if - is defined as a separator) and one is called subword navigation (as it involves examining the contents of a word -- commandWithFewWords is a group of characters containing 1 word and 4 subwords).

They usually have different implementations and the latter involves some interesting questions about localization e.g. myÜberCoolWord, therefore making it non-trivial to implement correctly.

@kumarharsh
Copy link
Contributor Author

@alexandrudima Oh... I was going to take a shot at it this weekend, but hadn't thought the case for localization at all. 😞

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants