microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.41k stars 29.33k forks source link

Inconsistent behavior of cursor keys #104633

Closed aloispichler closed 4 years ago

aloispichler commented 4 years ago

VS code is my favorite text editor for everything, for coding and for writing text (LaTeX, e.g.). The following behavior is inconsistent and always distracting:

Suppose the text we edit is "... brief text example ... "

  1. The key sequence ctrl+left, ctrl+ shift+left selects "text\~";
  2. the key sequence ctrl+right, ctrl+ shift+right selects "\~text" (note the blank "\~");
  3. the key sequence ctrl+left, ctrl+ shift+right selects "text";
  4. the key sequence ctrl+right, ctrl+ shift+left selects "text".

One operation, one intention, but 3 different results.

Only 1 is correct, the expected behavior for 1-4 above is always "text\~". Text editors, which do this correctly, include notepad, kile, texstudio, ... Did I miss a setting which fixes that?

This is how the problem should be resolved: ctrl + right should (behave as ctrl+left and) always position the cursor at the beginning of the following word (and never at the end of this word).

Thank you.

aloispichler commented 4 years ago

The problem regarding Ctrl+right is resolved here: https://github.com/microsoft/vscode/issues/34457 However, this should be the default behavior. Thanks.