Improve indenting options for multi-line Zed
Repro is in Brim commit ebc950d.
A community user pointed out that the query editor in the app could help the user write better multi-line Zed if it assisted with indentation. Here's a few options we discussed at a team sync, ordered by my guess at ease of implementation.
-
Indent when the user hits the Tab key. Currently, hitting Tab causes the cursor to leave the editor and start highlighting other parts of the interface. However, the user in this case said that it would have helped them if they could instead have used Tab to indent at the start of a new line.
-
Simple auto-indent. One team member suggested something like "if the user ends a line with a
(and then starts a new line (currently done via Shift-Enter), auto-indent the new line". -
Auto-indent based on full parsing. The UX team noted that they've recognized for some time that there could be benefits from having a full Zed parser in the app, as this could help with things like auto-suggestion/auto-complete of commands, color coding of different language elements, etc. If/when we pursue this, auto-indenting multi-line programs to adhere to best Zed practices could be tackled at the same time.
Regardless of which approach(es) are pursued, it seems there could be follow-on decisions to be made such as if the indent adds a genuine "Tab character" or a number of Spaces, and whether any of this is configurable via Preferences.
This one is in the "On Deck" pile on the assumption we'd attack the first item in the list soon, and once we've done that we can open issues for the others.
In a signal of additional interest, a community zync user asked about auto-indent today.