joshuto icon indicating copy to clipboard operation
joshuto copied to clipboard

simpler preview mode?

Open colemickens opened this issue 3 years ago • 4 comments

First, a small note: use_preview_script isn't listed in the example config, but seems like it's maybe needed to get previews to work.

I think it would be nice to have a simpler preview mode. For example bat already knows how to preview many types of files. It would be nice if joshuto could use bat as a lib or have a simpler mode where it can just use a single executable to naive handle any file type.

colemickens avatar Feb 26 '22 09:02 colemickens

I did a bit of research on this in the past when scoping out file preivews. And from what I've gathered, bat doesn't provide any libraries other rust programs can plug into.

So the only viable solution is to parse bat's output and convert that (ansi codes) into tui style structs.

kamiyaa avatar Apr 09 '22 16:04 kamiyaa

Hello.

Is the preview.sh run async?

And is the preview of a file cached, somehow ? Cuz I saw a white bar for every file which was previewed, but the second time when previewing, the white bar was no longer there ?

alexzanderr avatar Jul 23 '22 10:07 alexzanderr

Hi! Yes and yes. That's why the preview pane disappears for a very short time when the cursor moves to a not-yet-visited file and is then shown again once the preview text has been provided by preview.sh. (Assuming that the default configuration collapse_preview = true is used.)

Not really sure though what “white bar” you mean...

DLFW avatar Jul 23 '22 11:07 DLFW

yeah. collapse_preview = true. thanks for response. i understand now

alexzanderr avatar Jul 23 '22 13:07 alexzanderr