VS Code: moving the cursor to the line above (same position)

2

In the VS Code for Mac, is it possible to move the cursor to the line above at the same position (as the previous line)?

Currently, the cursor is being placed to the beginning of the line when moved above.

illustration of the problem

Anton K

Posted 2018-11-06T12:49:21.077

Reputation: 123

I'm not familiar with VS Code on Mac or Mac shortcut keys, but this might help https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

– spikey_richie – 2018-11-06T13:09:40.150

Answers

1

This is the normal behavior in all the text editors that I have encountered.

The caret will try to keep its column position, as long as characters exist in that position.

You have empty lines with no characters, so the editor cannot position the caret anywhere else than the beginning of the line. In your animation, I note that the line above the first const does contain some blanks so the caret can stay in its column.

There is no solution possible, unless you pad your empty lines with enough blanks, which isn't the best solution.

harrymc

Posted 2018-11-06T12:49:21.077

Reputation: 306 093