Why is typescript not autoindenting properly. Demonstrated here :
For TypeScript : You can see that the
} is moved to the right place. However the cursor end up at the start of the line. For JS both
} moves to the right line and the cursor moves to the right indent level.
As far as I know it gets driven by
editor.increaseIndentPattern which is the same for both
Funny thing is that atom does indent correctly if there is some character on that line (using code
editor = atom.workspace.getActiveEditor(); editor.autoIndentBufferRow(editor.getCursorBufferPosition().row)). e.g.
This there must be a character requirement is not needed for JS for some reason and I don’t see how that works (notice the indent line shows up after I run the code, it does not happen for TS if there isn’t any stuff on that line).