-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fix multiline outputs only showing the first line #128
Conversation
I think your suggested fix for the history would be good. It's probably better than the alternative. |
This keeps each entry grouped into one line instead of splitting the entry into multiple different entries in the history (as each entry in the history is separated by a newline).
The other option could be to split the history on a different separator than a newline (perhaps two newlines?), which would lead to results with variable answers saving as multiple lines in the same entry. |
Did you try that? If it renders properly, that would be the best option I think. |
I have not yet. The issue is that it isn't backwards compatible, so it would mess up people's current history (putting everything currently in their history as the same entry). |
That's a good point actually. Let's see whether the current approach is good enough for folks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working brilliantly, great work!
I like the idea of two separate history entries. |
Fixes #124 and #88. Instead of just truncating on the first line, display all bytes read (minus the newline) from stdout as the result. Here's the output with this fix:
The only issue I found is that the history will save a separate entry for each newline (in the picture above, the history would have
x=1
first and((3 x x) + 2) = 5
below it). This may be desired to allow users to be able to select just the variable solution or just the equation. However, if this isn't desired, then I can add another patch to replace all newlines in each history entry with a semicolon, so the entry would instead be((3 x x) + 2) = 5;x=1
.