[PATCH] [llgo] cmd/llgoi: use line editor

Peter Collingbourne peter at pcc.me.uk
Sun May 17 16:46:53 PDT 2015


Thanks for working on this much-needed usability improvement.

I played around with your change locally, and it seems to break one of the tests (`llgoi/panic.test`).


================
Comment at: cmd/llgoi/llgoi.go:503
@@ +502,3 @@
+		if in.pendingLine.ready() && buf.Len() > 0 {
+			in.liner.AppendHistory(buf.String())
+			buf.Reset()
----------------
It doesn't look like liner deals with multi-line history entries very well. (e.g. try typing "{<nl>}<nl><up>" and then editing the line). Can we maybe strip newlines and apply semicolon insertion where necessary instead of saving the literal newlines?

================
Comment at: cmd/llgoi/llgoi.go:522
@@ -521,3 @@
-	if tty {
-		os.Stdout.WriteString("\n")
-	}
----------------
It looks like liner doesn't do this for us, so we probably need to keep doing it ourselves.

http://reviews.llvm.org/D9811

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list