ans not automatically inserted when typing an operator on fresh start
If I start the program with history reloading, I can see the latest result, but ans is not available. Also, ans seems to be available after clearing history.
Syncing ans with history could make UI more straightforward: if you see the latest result in history, you can use it.
I already tested it in my repo and it is quite simple to implement.
Small concern is that ans being available after history clearing could be considered as an important feature for someone.
What do you think?
Comments (10)
-
repo owner -
reporter Happens with both official 0.12 on Windows and master branch on Linux.
Both "Save History on Exit" and "Automatic Result Reuse" on.
- 1+1 = 2
- /2 -> ans/2 = 1
- restart program
- /2 -> compile error
-
So your issue is not about
ans
not being available after restarting the program (which it is), but only that it is not automatically inserted when typing an operator? -
repo owner That's a completely different issue.
ans
is readily available on restart, but using an arithmetic operator to automatically insertans
does not work as expected. -
reporter Yes, the problem is with automatic insertion. I should have been clearer in original report.
Regarding the suggested fix in my repo, there seems to be unused member variable Editor::m_isAnsAvailable and setter function Editor::setAnsAvailable().
Is it meant for something?
-
repo owner - changed component to editor
- changed milestone to 1.0
- changed title to ans not automatically inserted when typing an operator on fresh start
-
m_isAnsAvailable
used to be read inEditor::autoCalc()
andEditor::autoCalcSelection()
, but it's been removed in cbd154e, probably because the expression would fail anyway ifans
is not available (@heldercorreia can you confirm?). If so, it can be removed indeed.BTW @syrja, please submit your changes and fixes through pull requests, as it's easier for us to study and merge them that way. In particular for
#808, as no one seems to be against it. -
reporter Pull request made with removal of Editor::m_isAnsAvailable.
-
repo owner Fixed by pull request #94.
-
repo owner - changed status to closed
- Log in to comment
I can't reproduce this with master branch on Linux. @syrja What OS and SpeedCrunch version are you on?