-
Notifications
You must be signed in to change notification settings - Fork 178
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
Add Option for Prefix-Based Reverse Search #424
base: master
Are you sure you want to change the base?
Conversation
} else { | ||
self.out.beep() | ||
self.restore(); |
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.
I don't know if this restore
breaks the following code:
Lines 558 to 559 in 88e669c
Cmd::HistorySearchBackward => s.edit_history_search(Direction::Reverse, false)?, | |
Cmd::HistorySearchForward => s.edit_history_search(Direction::Forward, false)?, |
b27c5ac
to
9b558c8
Compare
I rebased this PR to the newest master. Is there anything that's missing for a review? |
7a3494c
to
6743738
Compare
I squashed my commits to make rebasing easier and rebased onto the current master. The issue behind this PR in nushell comes up every now and again to allow nushell to have zsh-similar search behaviour taking into account the typed prefix. Is there anything I can do to help get this PR merged? |
6743738
to
3b2bbc8
Compare
@gwenn Is this PR something that could be of interest to rustyline? |
@gwenn We would really like to have this on nushell. Can you please look at this PR? |
Allow history search via Arrow-Up/Down or C-p/n to go either line-by-line or based on the prefix before the cursor position Fix kkawakam#423
3b2bbc8
to
64f21b4
Compare
Direction::Forward => history.len(), | ||
Direction::Reverse => 0, | ||
}; | ||
self.restore(); |
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.
bash history-search-backward
does not seem to loop or skip same history entries.
But you are right: cursor position is preserved.
I guess we should be able to use only a ConditionalEventHandler
: if no prefix => PreviousHistory
/ NextHistory
else => HistorySearchBackward
/ HistorySearchForward
.
eb68960 preserves cursor position. |
Allow history search via Arrow-Up/Down or C-p/n to go either line-by-line or based on the prefix before the cursor position
Fix #423