Created attachment 155257 [details] Screenshot showing garbled history output SUMMARY If you click the left mouse button in the history pane, subsequent calculations are not inserted cleanly at the top anymore, but intermingled with old calculations. STEPS TO REPRODUCE 1. Ensure history pane is enabled. 2. Calculate 1+2 (calculation shows up in history) 3. Left-click somewhere below "1 + 2 = 3" in the history pane. 4. Calculate 3*4 OBSERVED RESULT History now shows one line: "3 x 4 = 121 + 2 = 3" EXPECTED RESULT History should show two separate lines: "3 x 4 = 12" and "1 + 2 = 3". SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 22.04 KDE Plasma Version: 5.24.7 KDE Frameworks Version: 5.92.0 Qt Version: 5.15.3 ADDITIONAL INFORMATION The bad effect is delayed and might therefore not be associated with the click (Bug 452061, closed with status RESOLVED WORKSFORME, is probably an example of this bug). Possible reasons why the user might click in the pane: 1) Wanting to focus the entire window (click-to-focus) and choosing the history pane as it's a large and seemingly passive area. 2) Wanting to select some older result for copy & paste. 3) Exploring possibly hidden functionality in the history pane (that's how I ran into it).
I can confirm this bug exists, but it looks so weird. What changed after the history panel got clicked?
*** Bug 452061 has been marked as a duplicate of this bug. ***
Created attachment 155771 [details] KCalc history with line breaks between calculations Thank you! This has been bugging me for some time but could not locate what caused the behavior. I played around with it and it looks like the line break is inserted where the user last clicked in the history pane and the calculation add to the top. I was able to insert line breaks in between previous calculations this way.
I proposed a fix last week, but nobody seems to have time to review it yet, https://invent.kde.org/utilities/kcalc/-/merge_requests/55
(In reply to shenlebantongying from comment #4) > I proposed a fix last week, but nobody seems to have time to review it yet, > > https://invent.kde.org/utilities/kcalc/-/merge_requests/55 For what it's worth, I tested your fix locally and it has resolved the issue.
Git commit b45de2be468b74aa2d47583caf3801a52fa6bfaa by Joshua Goins, on behalf of shenleban tongying. Committed on 31/01/2023 at 12:51. Pushed by redstrate into branch 'master'. fix: insert new contents to correct locations Co-authored-by: Joshua Goins <josh@redstrate.com> M +11 -0 kcalchistory.cpp https://invent.kde.org/utilities/kcalc/commit/b45de2be468b74aa2d47583caf3801a52fa6bfaa