Skip to content
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

Persistent Command Buffer #2047

Merged
merged 15 commits into from Nov 9, 2023
Merged

Persistent Command Buffer #2047

merged 15 commits into from Nov 9, 2023

Conversation

jaadams5
Copy link
Contributor

@jaadams5 jaadams5 commented Nov 4, 2023

See https://kolmafia.us/threads/persistent-command-history-control-history-size.29213/

This saves the gCLI and tabbed chat command buffers to separate GLOBAL preferences. The commands are in a list delimited by the sharp sign which some people insist on calling a hashtag. The list is loaded on start up and the command index is set to the last element so an up arrow in a new session should select the last command from the previous session.

I've lightly tested this with the gCLI but not tabbed chat.

There was a request to allow the size of the buffer to be a preference. I decided NOT to implement that because if the size changed then the CommandDisplayFrame would have to be rebuilt or mafia shutdown and restarted before the effect was noticeable. It is trivial, now or later, to change the hardcoded 20 to something else if that is what people want.

@jaadams5 jaadams5 requested a review from a team as a code owner November 4, 2023 18:26
Copy link

codecov bot commented Nov 4, 2023

Codecov Report

Merging #2047 (5744cd1) into main (64464f0) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2047      +/-   ##
============================================
- Coverage     37.08%   37.08%   -0.01%     
  Complexity    19376    19376              
============================================
  Files          1093     1093              
  Lines        167505   167518      +13     
  Branches      35464    35465       +1     
============================================
  Hits          62117    62117              
- Misses        95460    95473      +13     
  Partials       9928     9928              
Files Coverage Δ
.../sourceforge/kolmafia/swingui/TabbedChatFrame.java 0.00% <0.00%> (ø)
...rceforge/kolmafia/swingui/CommandDisplayFrame.java 38.23% <0.00%> (ø)
...ge/kolmafia/swingui/panel/CommandDisplayPanel.java 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64464f0...5744cd1. Read the comment docs.

Copy link
Member

@midgleyc midgleyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work.

@jaadams5 jaadams5 merged commit ca51752 into main Nov 9, 2023
8 checks passed
@jaadams5 jaadams5 deleted the commandbuffer branch November 9, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants