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

Add "filter_mode_list" configuration option #1655

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matthiasbeyer
Copy link
Contributor

Closes #1654
Maybe closes #366

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

@matthiasbeyer
Copy link
Contributor Author

I did not yet test-drive this (also because I ran into #1653 while I started working on this).

I leave the discussion whether such a feature is desired to the issue (#1654 ) 👍

Comment on lines +363 to +364
if settings.workspaces && self.search.context.git_root.is_some() {
filter_modes.retain(|fm| *fm != FilterMode::Workspace);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just noticed that this might be wrong, the condition should be wrapped in a !(...) I guess.

I'll leave it this way until there's a decision whether this feature is desired or not. 😸

@matthiasbeyer
Copy link
Contributor Author

matthiasbeyer commented Jan 30, 2024

Also, this feature somewhat contradicts the filter_mode setting I guess, because implicitly the first entry in the filter_modes_list is the default, right? 🤔 We might want to have some discussion about this as well.

@matthiasbeyer
Copy link
Contributor Author

Any ideas about this?

@ellie
Copy link
Member

ellie commented Feb 12, 2024

I think it would make sense to add a [search] block

So

[search]
filters = ["session", "directory", "global"]

When set, it will override filter_mode and any other related settings.

Wrt workspaces, I'd suggest the following

  1. If a filter list is set, does not contain workspace, and workspaces = true. We should work with the current behaviour, of switching to workspace mode.
  2. If a filter list is set, and does contain workspace, then follow the order set in the list - regardless of whether workspaces = true.

@mattbaker
Copy link

I'd love to see this feature!

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.

Feature request: Allow changing order of filter modes Allow custom filtering rules
3 participants