[lldb-dev] Proposed change in multi-line edit behavior (Return = end/append, Meta+Return = line break)

Kate Stone via lldb-dev lldb-dev at lists.llvm.org
Tue Jul 12 15:48:02 PDT 2016


I’ve posted a new Phabricator review discussing this change @ http://reviews.llvm.org/D22284.  Comments welcome!

Editing multi-line content in a terminal environment involves a lot of trade-offs. When LLDB's multi-line editing support was first introduced for expressions / REPL contexts the behavior was as follows:

The Return key is treated as a line-break except at the end of the input buffer, where a completeness test is applied

This worked well enough when writing code, and makes it trivial to insert new lines above code you've already typed. Just use cursor navigation to move up and type freely. Where it was awkward is that the gesture to insert a line break and end editing is conflated for most people. Sometimes you want Return to end the editing session and other times you want to insert a line break.

This patch proposes a change in the behavior as follows:

The Return key is treated as the end of editing except at the end of the input buffer, where a completeness test is applied
The Meta+Return sequence is always treated as a line break. This is consistent with conventions in Facebook and elsewhere since Alt/Option+Return is often mapped to Meta+Return. The unfortunate exception is on macOS where this *can* be the case, but isn't by default. Sigh.

Note that by design both before and after the patch pasting a Return character always introduces a line break.

Kate Stone k8stone at apple.com <mailto:k8stone at apple.com>
 Xcode Low Level Tools

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160712/6f030f17/attachment.html>


More information about the lldb-dev mailing list