-
-
Notifications
You must be signed in to change notification settings - Fork 763
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
More minimal bat previews, minor improvements to fzplug #1004
Conversation
Should solve this. |
While we're at it, I'm wondering if we should set |
I would vote against showing the header for |
Totally, I agree. I would just leave it on I made the change but am waiting for opinions on |
You should be able to scroll the As far as I'm concerned the From the manpage:
|
Nice. I usually keep the human-readable flags in my scripts even if they're longer because those are most often commands I'm not used to and I prefer my scripts to be easy to edit without documentation, but this may not make sense here (unless we expect users to often customize their preview plugins without good knowledge of the associated utilities?). I do not dislike numbers, they're sometimes useful to me, particularly in combination with scrolling of the preview (thanks for clarifying that too), but I might be the only one. So that would be |
Yeah using human readable flags has merit in scripts I guess, I don't mind either way. On second thought I'm not so sure about passing the |
Good point; I don't have a |
The short aliases overwrite the We would have to come to a consensus on the style used (header/numbers or not) and anyone who has different preference would have to edit the script which I guess is fine. Paging @leovilok to see if they want to chime in. |
@leovilok please merge this when you guys are done. |
@luukvbaal please update the ToDo list after this is merged so users have an idea of what went it from the release notes. (I use the ToDo list of generate the release notes). |
Sure. Do you have an opinion on the issue btw? Either we use a more plain default(in which case we would have to decide whether or not to include line numbers) with the concession that |
Just realized we can also test if |
How about adding an example [Edit] Or that. |
Yeah just use `--style="${BAT_STYLE:-numbers}". Should be fine to merge then imo. |
For clarity the full |
I am trying to use if exists bat; then
case "$BAT_STYLE" in
"")
bat --terminal-width="$(tput cols)" --color=always --style=plain --paging=never "$@" 2>/dev/null &
;;
*)
bat --terminal-width="$(tput cols)" --color=always --style="${BAT_STYLE:-numbers}" --paging=never "$@" 2>/dev/null &
;;
esac
else What am I missing? I thought Note that there is no |
You don't need the case statement |
Oh, I was overcomplicating then. Thanks. |
Yeah if |
@Kabouik general feedback, please to NOT write comments in caps as you did in some of the plugins. |
Sure, I'll edit |
No, I am doing it. Please mind the spaces too. |
@luukvbaal with this command, |
You are using i.e. add it here
in |
@Kabouik please leave a note when done. |
Ah. Yes I was using kitty. Just started using it days ago, I didn't know about Sure @jarun. I'm sorry this takes longer than expected, it was initially a very simple change so I felt bravehearted enough for the PR (and it admittedly still is simple, but now it challenges my rather limited scripting knowledge :<). |
Does it work with |
Seems to work if |
For me it also works in |
In that case, and if it indeed seems necessary to pass Edit: I'm testing with |
I exported preview-tui.mp4Relevant lines in the script:
It seems this patch fixes it: - --env "USE_PISTOL=$USE_PISTOL" --env "BAT_STYLE=$BAT_STYLE" --env "PAGERPID=$PAGERPID" \
+ --env "USE_PISTOL=$USE_PISTOL" --env "BAT_STYLE=${BAT_STYLE:-numbers}" --env "PAGERPID=$PAGERPID" \ |
Yeah that's what I suggested in my previous comment. |
Phew. Tested in kitty + kitty preview and xterm + tmux preview, with and without env I had to add |
Thanks, looks good me for merging.
Again, I have |
@luukvbaal I am merging it. Please test and confirm things are good. @Kabouik Thank you! |
@luukvbaal please update the ToDo list when you have the time. |
Sure, done. See if it passes your style for the release notes. |
Thanks @luukvbaal! |
Did you remove the ToDo list item I added or did I forget to submit it? I would have sworn I submitted but I don't see it in the edit history lol. |
I didn't remove anything. |
Guess I didn't submit the edit then lol, added it now |
No description provided.