-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
Ported "Up Arrow key cycles through Query history" PR #2696
Conversation
- Add Reset CycleIndex when close window
e63c42e
to
3d6d79b
Compare
@@ -1116,6 +1163,7 @@ public void Show() | |||
|
|||
public async void Hide() | |||
{ | |||
lastHistoryIndex = 1; |
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.
Why is this reset needed?
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.
If you close the window and start the cycle again, you should see the most recent query first.
If a user set last query style to preserve or selected that means he wants to continue the working state if so. Maybe better to reset it only when empty?
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.
Why is this reset needed?
When the user closes the window, the index is initialized. Lastemptyquery is just a setting about query input, so it shouldn't have anything to do with this setting. It's kind of weird when I try it in without doing this initialization. When a new window opens, we should assume that the user is starting fresh. (For example, if the user puts in a few queries and then opens the flow again an hour later and does not initialize when using this feature, the user will skip commands that he does not remember.) Get rid of it and try it. It's weird.
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.
If you close the window and start the cycle again, you should see the most recent query first.
If a user set last query style to preserve or selected that means he wants to continue the working state if so. Maybe better to reset it only when empty?
It is also not a good idea to initialize when user delete a query. Not closing the window means that the user intends to keep it that way. When using the function in other cli programs, the index is maintained even if the query is deleted. This is a feature that cli users will mainly use, so it's right to follow this UX.
LGTM. |
What's the PR
Todo
Test Cases
ETC