zui icon indicating copy to clipboard operation
zui copied to clipboard

Improve editor UX for adding additional lines of Zed

Open philrz opened this issue 1 year ago • 0 comments

Repro is with Brim commit ebc950d.

A Zui Insiders community user expressed the following sentiment after having edited some multi-line Zed programs in the app:

I have a tendency to hit Return after new lines which executes the query instead of going to the next line to continue entering my complex queries.

Indeed, right now a user has to hit Shift-Enter to start new lines, while Enter always executes.

We discussed this at team sync. It's an interesting problem because we expect there's a set of users that's the opposite of this user, i.e., they mostly/always enter single-line queries (e.g., users doing simple search), and for them hitting Enter to execute may be seen as a great convenience. These same users might be annoyed if hitting Enter always started a new line they didn't expect and they instead had to learn a special key sequence or click a button to execute.

To be ready to satisfy the preferences of both types of users, the team reached consensus around having a setting in the Preferences menu to let the user choose whether Enter adds a newline or executes the current query.

@mccanne also put a third possible option on the table, which would be to still Enter-to-execute if it's a single-line query, but once the user has added one or more additional lines, now they'd need to hit a special key sequence (or click a button) to execute it. However, the current plan is to start with just the two options described above and see how that feels first.

philrz avatar Jul 20 '22 00:07 philrz