Skip to content

Commit 2620f49

Browse files
authored
Remove environment exports from preview thread (#1354)
1 parent 95b3613 commit 2620f49

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

doc.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ Format string of the box drawing characters enabled by the `drawbox` option.
673673
Set the path of a cleaner file.
674674
The file should be executable.
675675
This file is called if previewing is enabled, the previewer is set, and the previously selected file had its preview cache disabled.
676-
Five arguments are passed to the file, (1) current file name, (2) width, (3) height, (4) horizontal position, and (5) vertical position of preview pane respectively.
676+
The following arguments are passed to the file, (1) current file name, (2) width, (3) height, (4) horizontal position, (5) vertical position of preview pane and (6) next file name to be previewed respectively.
677677
Preview cleaning is disabled when the value of this option is left empty.
678678
679679
cursoractivefmt string (default "\033[7m")
@@ -844,7 +844,7 @@ Files containing the null character (U+0000) in the read portion are considered
844844
845845
Set the path of a previewer file to filter the content of regular files for previewing.
846846
The file should be executable.
847-
Five arguments are passed to the file, (1) current file name, (2) width, (3) height, (4) horizontal position, and (5) vertical position of preview pane respectively.
847+
The following arguments are passed to the file, (1) current file name, (2) width, (3) height, (4) horizontal position, and (5) vertical position of preview pane respectively.
848848
SIGPIPE signal is sent when enough lines are read.
849849
If the previewer returns a non-zero exit code, then the preview cache for the given file is disabled.
850850
This means that if the file is selected in the future, the previewer is called once again.

docstring.go

+7-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lf.1

+2-2
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ Format string of the box drawing characters enabled by the `drawbox` option.
825825
cleaner string (default '') (not called if empty)
826826
.EE
827827
.PP
828-
Set the path of a cleaner file. The file should be executable. This file is called if previewing is enabled, the previewer is set, and the previously selected file had its preview cache disabled. Five arguments are passed to the file, (1) current file name, (2) width, (3) height, (4) horizontal position, and (5) vertical position of preview pane respectively. Preview cleaning is disabled when the value of this option is left empty.
828+
Set the path of a cleaner file. The file should be executable. This file is called if previewing is enabled, the previewer is set, and the previously selected file had its preview cache disabled. The following arguments are passed to the file, (1) current file name, (2) width, (3) height, (4) horizontal position, (5) vertical position of preview pane and (6) next file name to be previewed respectively. Preview cleaning is disabled when the value of this option is left empty.
829829
.PP
830830
.EX
831831
cursoractivefmt string (default "\e033[7m")
@@ -1021,7 +1021,7 @@ Show previews of files and directories at the right most pane. If the file has m
10211021
previewer string (default '') (not filtered if empty)
10221022
.EE
10231023
.PP
1024-
Set the path of a previewer file to filter the content of regular files for previewing. The file should be executable. Five arguments are passed to the file, (1) current file name, (2) width, (3) height, (4) horizontal position, and (5) 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.
1024+
Set the path of a previewer file to filter the content of regular files for previewing. The file should be executable. The following arguments are passed to the file, (1) current file name, (2) width, (3) height, (4) horizontal position, and (5) 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.
10251025
.PP
10261026
.EX
10271027
promptfmt string (default "\e033[32;1m%u@%h\e033[0m:\e033[34;1m%d\e033[0m\e033[1m%f\e033[0m")

nav.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,12 @@ func (nav *nav) previewLoop(ui *ui) {
702702
}
703703
win := ui.wins[len(ui.wins)-1]
704704
if clear && len(gOpts.previewer) != 0 && len(gOpts.cleaner) != 0 && nav.volatilePreview {
705-
nav.exportFiles()
706-
exportOpts()
707705
cmd := exec.Command(gOpts.cleaner, prev,
708706
strconv.Itoa(win.w),
709707
strconv.Itoa(win.h),
710708
strconv.Itoa(win.x),
711-
strconv.Itoa(win.y))
709+
strconv.Itoa(win.y),
710+
path)
712711
if err := cmd.Run(); err != nil {
713712
log.Printf("cleaning preview: %s", err)
714713
}
@@ -747,8 +746,6 @@ func (nav *nav) previewDir(dir *dir, win *win) {
747746
var reader io.Reader
748747

749748
if len(gOpts.previewer) != 0 {
750-
nav.exportFiles()
751-
exportOpts()
752749
cmd := exec.Command(gOpts.previewer, dir.path,
753750
strconv.Itoa(win.w),
754751
strconv.Itoa(win.h),
@@ -807,8 +804,6 @@ func (nav *nav) preview(path string, win *win) {
807804
var reader io.Reader
808805

809806
if len(gOpts.previewer) != 0 {
810-
nav.exportFiles()
811-
exportOpts()
812807
cmd := exec.Command(gOpts.previewer, path,
813808
strconv.Itoa(win.w),
814809
strconv.Itoa(win.h),

0 commit comments

Comments
 (0)