Closed austincondiff closed 1 year ago
Could be work a look:
https://github.com/ChimeHQ/TextFormation
Indentation calculation is incredibly complex in the general case. But that library can do some basics, and also be used in combination with a more sophisticated indentation calculation system.
Could be implemented using https://github.com/ChimeHQ/TextFormation
When the user presses return to create a new line, we should auto-indent the new line for them.
The amount of indentation to give the new line will be based on the previous line's indentation, or if the previous line ends in a
{
,[
,(
, or<
, increase the indent.If there is a matching
}
,]
,)
, or>
, we need to add it to a new line underneath the new line and indent it the same amount of indentation as the original line the user was on before they created the new line.https://user-images.githubusercontent.com/806104/194420921-e340fb32-43b9-40ff-b05b-0c416c3e2cac.mp4
Related
79