Skip to content
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

global_search: Save only the primary query to the history register #11216

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

the-mikedavis
Copy link
Member

Two changes from #11209 (which this PR partially reverts):

  • Save only the Picker::primary_query - so you don't save other parts of the query, for example %path foo.rs while in global_search.
  • Move the saving out of the if let Some(option) = self.selection() block. So when you hit enter you save to history whether you have a selection or not. If you want to close the picker without saving to the register you can use C-c or Esc instead.

Fixes #11214 and addresses part of #11205 (comment)

Two changes from the parent commit:

* Save only the `Picker::primary_query` - so you don't save other parts
  of the query, for example `%path foo.rs` while in `global_search`.
* Move the saving out of the `if let Some(option) = self.selection()`
  block. So when you hit enter you save to history whether you have a
  selection or not. If you want to close the picker without saving to
  the register you can use C-c or Esc instead.
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

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

Nice!

@archseer archseer merged commit b927985 into master Jul 18, 2024
6 checks passed
@archseer archseer deleted the picker-history-fix branch July 18, 2024 02:08
mxxntype pushed a commit to mxxntype/helix that referenced this pull request Aug 14, 2024
…elix-editor#11216)

Two changes from the parent commit:

* Save only the `Picker::primary_query` - so you don't save other parts
  of the query, for example `%path foo.rs` while in `global_search`.
* Move the saving out of the `if let Some(option) = self.selection()`
  block. So when you hit enter you save to history whether you have a
  selection or not. If you want to close the picker without saving to
  the register you can use C-c or Esc instead.
stackotter pushed a commit to stackotter/helix that referenced this pull request Aug 28, 2024
…elix-editor#11216)

Two changes from the parent commit:

* Save only the `Picker::primary_query` - so you don't save other parts
  of the query, for example `%path foo.rs` while in `global_search`.
* Move the saving out of the `if let Some(option) = self.selection()`
  block. So when you hit enter you save to history whether you have a
  selection or not. If you want to close the picker without saving to
  the register you can use C-c or Esc instead.
kyruzic pushed a commit to kyruzic/helix that referenced this pull request Sep 27, 2024
…elix-editor#11216)

Two changes from the parent commit:

* Save only the `Picker::primary_query` - so you don't save other parts
  of the query, for example `%path foo.rs` while in `global_search`.
* Move the saving out of the `if let Some(option) = self.selection()`
  block. So when you hit enter you save to history whether you have a
  selection or not. If you want to close the picker without saving to
  the register you can use C-c or Esc instead.
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.

Global search path filter becoming part of the search history
3 participants