Skip to content

REPL replay caret is misaligned with replay prompt #12178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
som-snytt opened this issue Oct 2, 2020 · 3 comments
Closed

REPL replay caret is misaligned with replay prompt #12178

som-snytt opened this issue Oct 2, 2020 · 3 comments
Labels

Comments

@som-snytt
Copy link

som-snytt commented Oct 2, 2020

reproduction steps

using Scala (add version here),

scala 2.13.3> scala> f"${0}%%%%%d"

// Detected repl transcript. Paste more, or ctrl-D to finish.

val res13: String = %%0

// Replaying 1 commands from transcript.

scala> f"${0}%%%%%d"
                        ^
              error: conversions must follow a splice; use %% for literal %, %n for newline


scala 2.13.3> f"${0}%%%%%d"
                        ^
              error: conversions must follow a splice; use %% for literal %, %n for newline

problem

The transcript of the replayed transcript should look normal, with caret pointing at the error.

I expected a special replay> prompt, as happens with :replay command, or maybe paste>.

Error reporting has to factor in the current prompt of whatever width.

This may seem like niche behavior, but cut/pasting example snippets is job Nr 1 in REPL. Some work has gone into getting everything to line up, so by the sunk cost fallacy, we should sink more.

@SethTisue SethTisue added the repl label Oct 6, 2020
@SethTisue SethTisue added this to the Backlog milestone Oct 6, 2020
@SethTisue
Copy link
Member

I confess to neglecting the transcript-pasting feature during the JLine 3 upgrade process.

@som-snytt
Copy link
Author

The old way was also a bit funky, in that the echoed text doesn't align with anything before it.

scala 2.12.12> scala> f"${0}%%%%%d"

// Detected repl transcript. Paste more, or ctrl-D to finish.

// Replaying 1 commands from transcript.

scala> f"${0}%%%%%d"
<console>:12: error: conversions must follow a splice; use %% for literal %, %n for newline
               f"${0}%%%%%d"
                         ^

@som-snytt
Copy link
Author

It would be nice if repl display worked uniformly irrespective of source context, but no one uses replay anyway.

@SethTisue SethTisue removed this from the Backlog milestone Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants