top | item 30704609

(no title)

ThinBold | 4 years ago

In vscode, tab (the key above capslock) is implemented by counting how many characters are on the current line and adding 4floor(x/4+1)-x spaces to the current line.

This obviously doesn't work if there are non-ascii characters that (have to) use a different font and hence having different widths. Or if you prefer variable-width font, then a purely ascii document will break tab.

The developers reply on github that this (characters having different widths) is a frontend thing and they don't have enough API that can fix this. But of course since vscode is an open source project you can always fork it and fix it yourself.

I don't know any other editor that cannot handle tab.

discuss

order

nosefrog|4 years ago

FWIW, the default behavior in Emacs is that tab indents the line to what its heuristics tell it the line should be at, no matter where your cursor is in the line. This is confusing at first, but as long as the heuristic is correct it's pretty nice (but it drives you crazy when the heuristic is wrong for whatever reason).

ThinBold|4 years ago

I check the document and the it looks great. Even if it fails to work at least you are always brought back to an integer value of x-coordinate.