codepod
codepod copied to clipboard
weird line position in code editor
Sometimes a very long line does not start at where it is supposed at but a line below it. See the screenshot below.

In the screenshot above, "t" in "telomeres" should appear right under "n" of "include". The indentation is 4-space.
This happens after using backspace at the beginning of the issue-occurring line.
It seems an old bug in monaco-editor, I also found it in leetcode.com, which also utilizes monaco as its web editor:

Update: I see. I searched a little and found it is not a bug, just a feature. The editor option WrappingIndent controls the indent of wrapped words. The default value is None set by Microsoft themselves, which forces all wrapping lines start at the leftmost column. I don't know why they preset like that, Maybe it is a popular feature accepted by most of the users?
Of course, I can set it as Same to make the wrapped lines with the same indent as the first line if you think this is a better feature than None.