Add ability to use image previewers (#531)

* Return early on error in nav.preview

* nav.checkReg now returns a boolean instead of calling nav.preview

* Pass width, height, x, and y parameters to preview script

* Check previewer for exit code

If non-zero the preview will be assumed to have side-effects.

* Add the cleaner option

This is called upon selection changes if the previous preview was
volatile. To this end, volatilePreview was added to the nav struct
This commit is contained in:
neeshy authored and GitHub committed 2020-12-24 16:13:20 +03:00
1 parent c2fe88e9a0
commit 82f03102a5
9 files changed
+98 -25

No files matched your search

+2
View File
@@ -51,6 +51,7 @@ var gOpts struct {
filesep string
ifs string
previewer string
cleaner string
promptfmt string
shell string
timefmt string
@@ -89,6 +90,7 @@ func init() {
gOpts.filesep = "\n"
gOpts.ifs = ""
gOpts.previewer = ""
gOpts.cleaner = ""
gOpts.promptfmt = "\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[1m%f\033[0m"
gOpts.shell = gDefaultShell
gOpts.timefmt = time.ANSIC