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:
1 parent
c2fe88e9a0
commit
82f03102a5
9 files changed
+98
-25
No files matched your search
+16
-5
@@ -121,6 +121,7 @@ The following options can be used to customize the behavior of lf:
|
||||
period int (default 0)
|
||||
preview bool (default on)
|
||||
previewer string (default '')
|
||||
cleaner string (default '')
|
||||
promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[1m%f\033[0m")
|
||||
ratios []int (default '1:2:3')
|
||||
relativenumber bool (default off)
|
||||
@@ -624,11 +625,21 @@ binary files and displayed as 'binary'.
|
||||
previewer string (default '') (not filtered if empty)
|
||||
|
||||
Set the path of a previewer file to filter the content of regular files for
|
||||
previewing. The file should be executable. Two arguments are passed to the
|
||||
file, first is the current file name, and second is the height of preview
|
||||
pane. SIGPIPE signal is sent when enough lines are read. Preview filtering
|
||||
is disabled and files are displayed as they are when the value of this
|
||||
option is left empty.
|
||||
previewing. The file should be executable. Five arguments are passed to the
|
||||
file, first is the current file name; the second, third, fourth, and fifth
|
||||
are height, width, horizontal position, and vertical position of preview
|
||||
pane respectively. SIGPIPE signal is sent when enough lines are read. If the
|
||||
previewer returns a non-zero exit code, then the preview cache for the given
|
||||
file is disabled. This means that if the file is selected in the future, the
|
||||
previewer is called once again. Preview filtering is disabled and files are
|
||||
displayed as they are when the value of this option is left empty.
|
||||
|
||||
cleaner string (default '') (not called if empty)
|
||||
|
||||
Set the path of a cleaner file. This file will be called if previewing is
|
||||
enabled, the previewer is set, and the previously selected file had its
|
||||
preview cache disabled. The file should be executable. Preview clearing is
|
||||
disabled when the value of this option is left empty.
|
||||
|
||||
promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%w/\033[0m\033[1m%f\033[0m")
|
||||
|
||||
|
||||
Reference in new issue
Block a user