Conversation
There was a problem hiding this comment.
Pull request overview
This PR modifies the history filtering behavior in the fzf history search and adds the '-f' flag to the development console. The title references adding a '-f' flag and reversing history filtering.
Changes:
- Modified history filtering to reverse the array before deduplication, changing which duplicate entries are preserved
- Removed the
--tacflag from the fzf command options - Added the
-fflag to ARGV in the console script to prevent loading .irbrc files
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/reline_pac/packages/history.rb | Changed history processing order by reversing the array before filtering and removed the --tac fzf flag |
| bin/console | Added -f flag to ARGV to prevent IRB from loading initialization files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| seen = {} | ||
| filtered = all_history.filter_map do |h| | ||
| filtered = all_history.reverse.filter_map do |h| |
There was a problem hiding this comment.
Reversing the history array before filtering changes the deduplication behavior. Previously, when a command appeared multiple times in history, the oldest occurrence was kept (since the array was processed chronologically and the first occurrence was added to the 'seen' hash). Now, the newest occurrence will be kept. While this might be the intended behavior, it's a semantic change that affects which duplicate entry is preserved. Consider whether this change in deduplication logic is intentional and whether it should be documented or tested.
…tory filtering