Skip to content

Differences between previewer bat and bat_native? #1110

Answered by ibhagwan
josh-nz asked this question in Q&A
Discussion options

You must be logged in to vote

The “native” as its name suggests sets fzf’s preview command directly to bat <args> <filename>, however for filename is then replaced with a neovim --headless --cmd <lua> command in order to properly extract the filename from the entry (strip icons, etc) - this approach has obvious limitations with tags for example where the entry doesn’t have a line number and other issues with Windows where the files index for the line number differs between relative paths and absolute paths (due to the extra C: prefix when our delimiter is :).

The non native version uses a neovim --headless … directly as fzf’s --preview argument and then spawns bat using libuv’s spawn and streams the data over named pi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by josh-nz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants