Open aeghn opened 4 years ago
Could you explain what coproc is and how it works? I like to know how the code works before merging it :)
You can learn how coproc works in this page.
And I add some annotation to explain it.
Hit Ctrl-h
to see this help.
I have finished what I need. If you want to merge these commits, I wiil resolve the conflicts. :)
@aeghn That looks great!
Is it by any chance possible to have the help menu in the same window? Or is that something fzf
is not capable of doing?
I don't think to add everything to one page is a good thing. It will make that page messy.
Or could you make a make a diagram to explain ? @sdushantha
@aeghn Now I get what you did. I thought that the help menu was in a separate terminal window. I just read the code now and realized that in your screenshot, the you have the help menu in a separate terminal window just for the displaying purpose.
Just so you know, when you press [CTRL+S], when you are selecting the preview text from the history, the texts with \n
wont show fully.
@sdushantha I'd like to open a new fzf window to show preview text page or help which just cover the old fzf window without change its status.
And I just fixed the bug you mentioned above. If you find any other bugs please tell me.
Could you put the font info on the right side? And display the help menu in the same way as the font info instead of starting a new fzf session? This way everything would look cleaner :)
Thank you for helping out a lot! After we merge this PR fontviewer
will be really useful for people!!
I tried to use a file to store the flag of whether showing help to achiveve this.
Everything seems to work well except one small thing...
When launching fontviewer
it opens with the font info. It would be better to allow users to toggle it afterwards. At the moment, I can take it away by hitting CTRL+i. After doing so, when I hit CTRL+h to show the help, nothing happens. I have to first enable the font info and then hit CTRL+h in order to display the help menu.
After the fixing the tiny issue I mentioned above, I will merge it :)
It would be better to allow users to toggle it afterwards.
Actually fzf
provided an arg to hide preview window by default. But I learned that you want to display pictures directly in fzf preview window, so I think it's okay to show preview by default.
After doing so, when I hit CTRL+h to show the help, nothing happens.
The result is as expected, fzf
refresh its preview by toggle-preview
twice. And fzf
didn't provide an action just to open preview, besides, we couldn't get whether preview‘s status except to see by eyes. So, it's almost impossible except fzf
add those one day.
But we can make a fake toggle action by modifying fzf_preview
, like this:
That almost succeeded except for the annoying border :(
That almost succeeded except for the annoying border :(
How did you did you initially create the info window then? Because in the last commit, you had the info menu/window shown and it would go away when you pressed CTRL+i again. Hope that made sense
Because I think that was a failed attempt so I didn't submit it.
In my opinion, if you want to show font info and help message in one window and switch them by shortcuts, it's better to make preview window persist. Or add the option below the font, but this still need you to open preview window manually.
Btw, what do you think of the help and information window now?
I made some minor changes from commit fef95fe314ac410da272ac336e89e0449b58bbfb: https://0x0.st/i-Oq.sh
I think it seems better now. Could you check it out and let me know what you think about it?
Also, Im a little confused with the code you wrote because Im not at your level of bash scripting, so just a small heads up that I might ask how something works in the future if I want to tweak it :+1:
Cool script! Here are some ideas I finished.