question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using left/right arrow keys to jump between wrapped lines causes cursor to skip a character

See original GitHub issue

Does 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:

  1. Enable word wrapping
  2. 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>

  1. Resize panes to force word wrapping (targeting the <p>...</p> line above).
  2. Place cursor at the end of the first line that is word-wrapped (most likely after a whitespace).
  3. Press right arrow key. Cursor skips to the second position of the next line.
  4. Press left arrow key once. Cursor goes to first position of the next line.
  5. 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:open
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
hedietcommented, Oct 15, 2021

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.

1reaction
alexdimacommented, Jun 21, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found