Skip to content

Conversation

@xozzslip
Copy link

@xozzslip xozzslip commented Aug 8, 2024

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.

@dvorka dvorka requested review from Copilot and dvorka May 9, 2025 06:53
@dvorka dvorka self-assigned this May 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

if(hstr->view==HSTR_VIEW_FAVORITES) {
favorites_choose(hstr->favorites,result);
}
} else {
Copy link

Copilot AI May 9, 2025

Choose a reason for hiding this comment

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

[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.

Copilot uses AI. Check for mistakes.
@dvorka dvorka assigned xozzslip and unassigned dvorka May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants