-
Notifications
You must be signed in to change notification settings - Fork 157
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
How to show a preview when typing or moving cursor #838
Comments
sounds a bit dangerous. However, nushell with the |
Yeah... But my use case is a math evaluator and in that case it is fine. |
With the current design of reedline there are no provisions for that (parallel evaluation, with managed output). From our side this has a low priority (we as Nushell would probably only use such facilities for other status output, without clear existing requirements for that yet). Currently reedline's add-on components are all evaluated in line and in a blocking fashion. So if anything takes too long the UI slows down/freezes. We could accept something in the same vain without much redesign, but if you want that particular feature non-blocking we clearly have to prioritize the design of asynchronous updates for the more important components of reedline. |
Parallel evaluation is not too relative imo. To make it possible with minimal effort, reedline could manage an output buffer which is always shown below the line buffer, and reedline could also provide a function to update its content like The hard point for me is the drawing logic. I'm new in this field. I think it's possible because the menu is working well. I'm appreciate if you could give me some links or file position that I can start from. |
Is it possible to print a preview (maybe multiline) when user is typing or moving the cursor, like a menu that the user can not interact with.
Example
When editing, print the evaluation preview of the expression under the cursor:
Once enter is hit, clear the preview, and the main program prints the result:
In nushell, user can edit the filter expression and preview the result:
The text was updated successfully, but these errors were encountered: