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

[fzf] Pass different options to fzf for display #12

Closed
runofthemillgeek opened this issue Jul 22, 2019 · 6 comments
Closed

[fzf] Pass different options to fzf for display #12

runofthemillgeek opened this issue Jul 22, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@runofthemillgeek
Copy link

Hi there! Loving the tool you created. I have FZF_DEFAULT_OPTS set in my .zshrc which sets preview window by default. As you may have guessed, this doesn't really work well with cani. Is it possible to pass or set different fzf options for cani?

@SidOfc SidOfc self-assigned this Jul 24, 2019
@SidOfc SidOfc added the enhancement New feature or request label Jul 24, 2019
@SidOfc
Copy link
Owner

SidOfc commented Jul 24, 2019

Hey there, thanks for reporting this issue!

I don't think I made it configurable but I can figure out a way to make it configurable at least, in that way the user has control over the options passed, I think a nice place to put it would be in the configuration file that already gets created upon initialization.

Right now I'm heading to bed (2AM here, got work tomorrow) but I'll work on it tomorrow and hopefully release a new version on the same day 👍

@SidOfc SidOfc closed this as completed in d5f3b70 Jul 24, 2019
SidOfc added a commit that referenced this issue Jul 24, 2019
Always disable --preview when running FZF. Fixes #12
@SidOfc
Copy link
Owner

SidOfc commented Jul 24, 2019

Hi @sangeeth96!

I went with a much simpler solution that just disables the preview by applying --no-preview explicitly. I also found another bug that would make cani crash when being run without arguments so cheers for leading me to that discovery as well 👍

Issues should be fixed and a new version of cani has been released. Run: gem update cani and see if the version you install is indeed 0.5.6.

Let me know if you experience any other issues ✌️

@runofthemillgeek
Copy link
Author

@SidOfc Yaay! Seems to be working alright now:

image

May I ask if it's supposed to take only half the width of the terminal or is that also because of my FZF_DEFAULT_OPTS?

@SidOfc
Copy link
Owner

SidOfc commented Jul 26, 2019

The reason it does not span the entire terminal is because all data is completely shown and nothing else comes after it, this is how FZF behaves by default. If you'd like to see more information check out the config file located in ~/.config/cani/config.yml which lists the default browsers shown by cani in a browsers key.

The values you can use are the keys of the agents object from Caniuse JSON data which can be found here: https://raw.githubusercontent.com/Fyrd/caniuse/master/data.json.

The browsers key also defines the order in which the browsers are displayed and can be safely changed to match your personal preference as well :)

@SidOfc
Copy link
Owner

SidOfc commented Jul 28, 2019

Hi @sangeeth96!, I think I misunderstood when you first asked about the screen width taken up by FZF. I truncated the titles to 24 characters max. I've added a check and published version 0.5.8 on rubygems which allow titles to grow up to 50 characters in the cani use screen.

This also happens to make features more searchable since more of the text is available to actually search for now.

image

@runofthemillgeek
Copy link
Author

@SidOfc Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants