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 extra modes #111

Merged
merged 2 commits into from
Oct 31, 2023
Merged

Add extra modes #111

merged 2 commits into from
Oct 31, 2023

Conversation

marcdeop
Copy link
Contributor

This is a reduced version of #103

What this PR does:

New variable

Introduces extrakto_fzf_unset_default_opts in order to unset the environment variable FZF_DEFAULT_OPS.

I found out that certain operations would not work with my default FZF_DEFAULT_OPS value.

For example:
Having the option -1 (or --select-1) will make extracto's pop-up disappear immediately when there is 0 or just 1 match thus preventing you from switching to another filter.

Support other modes

Extra modes added:

  • path
  • url
  • quote
  • s-quote

Cosmetics

Add --word as a parameter for the sake of consistency.

How to try?

Before this PR:

set -g @extrakto_filter_order "url line quote s-quote word path all"

And no matter what you did, the filters would always be: word all line

Now calling extracto will give you the url filter as default as expected.

@laktak laktak merged commit c55b76a into laktak:master Oct 31, 2023
1 check failed
@laktak
Copy link
Owner

laktak commented Oct 31, 2023

Thank you for your PR! I didn't know about FZF_DEFAULT_OPS causing side effects.

I reverted the changes to the extrakto.py since the -a option already let's you add custom filters.

@laktak
Copy link
Owner

laktak commented Oct 31, 2023

Also you gave me the idea to use -a with user defined filters :)

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