microsoft / microsoft/vscode

Next/Previous word selection does not respect newlines correctly

Open
#332,659 0 comments 0 reactions 1 assignee Claimed by @hediet View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

This has been an "issue" for multiple years now. I don't think it's necessarily a bug, since this behavior is present in a lot of editors (VSCode, Zed, ), however there should be an option for this to be disabled.
Take this example:
```Papyrus
Event OnUpdate()|
Debug.Trace("Doing something...")
EndEvent
```
When we now use e.g. Ctrl+Right, instead of the cursor going here:
```Papyrus
Event OnUpdate()
| Debug.Trace("Doing something...")
EndEvent
```
It instead goes here:
```Papyrus
Event OnUpdate()
Debug|.Trace("Doing something...")
EndEvent
```

Adding newlines (\r, \n, \r\n) to the word separator characters changes nothing either.

This is not an issue specific to in this case a used papyrus language extension, it is also present in any other type of file, even in simple text files. It is very cumbersome to work with this, especially when this is not an issue in e.g. Jetbrains IDE's, or even simpler editors like Notepad++.

Does this issue occur when all extensions are disabled?: Yes

- VS Code Version: 1.134.0
- OS Version: Windows 11 25H2

Steps to Reproduce:
1. Use Ctrl+Left when at the beginning of a line, or Ctrl+Right while at the end of a line.
2. Cursor goes to a rather random position.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.