Using left/right arrow keys to jump between wrapped lines causes cursor to skip a character
See original GitHub issueDoes this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.58.0-insider, 1.57.1 stable
- OS Version: macOS 11.4
Steps to Reproduce:
- Enable word wrapping
- Create file with contents such as:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<p>This is an example of a simple HTML page with one paragraph.</p>
</body>
</html>
- Resize panes to force word wrapping (targeting the
<p>...</p>
line above). - Place cursor at the end of the first line that is word-wrapped (most likely after a whitespace).
- Press right arrow key. Cursor skips to the second position of the next line.
- Press left arrow key once. Cursor goes to first position of the next line.
- Press left arrow key again. Cursor goes to second last position of the previous line.
Demo video:
https://user-images.githubusercontent.com/9157833/122717474-82317d80-d220-11eb-9d9a-a78167c8a6a7.mov
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Arrow keys skip to end of documents and lists - Super User
If I'm typing a document and hit the left arrow key, instead of going back a single character, it now goes back to...
Read more >VS Code, navigate within a wrapped line vs jumping to next line
In vs code I've noticed that when line wrap is enabled using the arrow keys to go to the next line causes the...
Read more >Left & right arrow keys don't move the cursor (in teams)
So it is clear the arrow keys on the keyboard are functioning and sending signals to the computer.
Read more >Text cursor movement across word-wrap boundary broken
Moving the text cursor across the word-wrap boundary using the left arrow key causes the cursor to land before the trailing white-space on ......
Read more >Arrow navigation issue with single-character text node ...
Click anywhere in the first link. Use the right/left arrow keys to move around. You cannot move the cursor to the left of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we should skip the cursor stop if there are multiple cursors, but don’t skip it in case of a single cursor. The same should happen for injected text.
This behavior is intentional. When using word wrapping, the very last view position on a wrapped line and the very fist view position on a subsequent wrapped line map to the same model position. This can be seen by clicking at those positions and looking in the status bar for the cursor position. We did not find useful to introduce a cursor stop at the two view positions that point to the same model position.