Edit the first search result if available#523
Open
xozzslip wants to merge 1 commit intodvorka:masterfrom
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements the behavior to edit the first search result if available when not in favorites view.
- Added a conditional branch in loop_to_select() to update the result from the first entry in the selection array.
- Falls back to the original pattern assignment if no selection exists.
| @@ -1598,7 +1598,11 @@ void loop_to_select(void) | |||
| favorites_choose(hstr->favorites,result); | |||
| } | |||
| } else { | |||
There was a problem hiding this comment.
[nitpick] Add a comment explaining that when the search results are not empty, the first result is selected for editing; this will help maintain clarity for future maintainers.
Suggested change
| } else { | |
| } else { | |
| // If there are search results, select the first result for editing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I often use Ctrl+R to search for commands with the intention of editing them rather than executing. Typically, I find myself wanting to edit the first command that appears in the search results.