Repository navigation
Fix the REPL's rough edges with output, keys and the editor - #32
Merged
Merged
Conversation
Printing above the prompt takes whole lines only, so the start of a line from another thread waited for its newline, which a question or dots showing progress may never print, and then ran into the next value. It now goes above the prompt a quarter of a second after it comes, on a line of its own, or before what's printed next, once the line's been read, whichever's first.
JLine clears what goes below the line, the search's prompt among it, whenever it shows a tail tip, which eldoc uses, so Ctrl-R and Ctrl-S searched blind. The search now runs with the tip turned off.
Enter on a frame without source, a Java one say, left the view for the prompt with a message, so trying the next frame meant starting over, and so did opening a second frame in the editor. The message goes on the view's status line now, and the view comes back, on the same frame, once the editor exits.
,edit took a jar: URL, which is where the server says a library's definitions are, for a file it couldn't find. The file gets copied out of its jar into neorepl's cache, read-only, since changing it changes nothing, and again when the jar changes, as a snapshot's can.
The terminal echoed what was typed while an evaluation ran, in among what the evaluation printed, and the line editor showed it again at the next prompt, where it goes. Echo's off while an evaluation runs now, and while a command waits on the server for a lookup, like ,reload, so it only shows up there. Ctrl-C still interrupts, and a read from *in* still shows what's typed, the line editor doing that itself.
The marks say what index to push a value by, which neorepl inspect --push and the full-screen inspector take, but the REPL without a line editor has no way to push, so they were only noise there.
In the REPL without a line editor, the terminal echoes ^C where the cursor is, and "The evaluation was interrupted" followed it on the same line. The REPL now ends that line first, before the interrupt, which waits for the server, and before exiting at the prompt. Only when standard input is a terminal that echoed the ^C, though: Emacs' M-x shell has echo off, and would get an empty line.
Arglists longer than what's left of the line, like a Java method's or those of a function with many arities, wrapped onto the lines below the one being edited. The tip now ends in an ellipsis where the line does, the prompt's width coming from the read that shows it.
The menu showed what's typed so far in cyan and the candidates' types in gray, JLine's styles, whatever NO_COLOR said. An empty style doesn't turn them off, since JLine falls back on its own for a style that comes out as none, so they're the terminal's default color instead.
The REPL had rebel-readline's C-x C-d for docs, but not the other two of its keys, which babashka's REPL has as well. C-x C-s shows the source of the symbol at the cursor, or of the call it's in, highlighted, and C-x C-a the vars whose names have the symbol in them, taken literally rather than as a regex. Both wait up to five seconds, being asked for.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for the interactive REPL: partial lines from other threads, Ctrl-R's prompt under eldoc, typed-ahead text echoed into evaluation output, eldoc tips that wrap, and
NO_COLORin the completion menu.,stacktraceno longer drops back to the prompt on a frame without source,,editopens definitions in jars as copies, and C-x C-s and C-x C-a join C-x C-d.Echo is off only while an evaluation or a lookup runs, not for the whole session, so an editor opened with
,editstill gets a terminal that echoes.