update doc

This commit is contained in:
Gokcehan 2021-01-18 23:44:26 +03:00
parent f54acae958
commit af988284a4
3 changed files with 31 additions and 2 deletions

8
doc.go
View File

@ -1149,6 +1149,14 @@ Besides, it is also important that the application is processing the file on the
This is especially relevant for big files.
lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read.
When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview.
Note that some programs may not respond well to SIGPIPE to exit with a non-zero return code and avoid caching.
You may trap SIGPIPE in your preview script to avoid error propogation:
#!/bin/sh
trap "" PIPE
...
You may also use an existing preview filter as you like.
Your system may already come with a preview filter named 'lesspipe'.

View File

@ -1286,7 +1286,16 @@ reading it to the memory and then do the processing afterwards. This is
especially relevant for big files. lf automatically closes the previewer
script output pipe with a SIGPIPE when enough lines are read. When
everything else fails, you can make use of the height argument to only feed
the first portion of the file to a program for preview.
the first portion of the file to a program for preview. Note that some
programs may not respond well to SIGPIPE to exit with a non-zero return code
and avoid caching. You may trap SIGPIPE in your preview script to avoid
error propogation:
#!/bin/sh
trap "" PIPE
...
You may also use an existing preview filter as you like. Your system may
already come with a preview filter named 'lesspipe'. These filters may have

14
lf.1
View File

@ -1267,7 +1267,19 @@ Since this script is called for each file selection change it needs to be as eff
esac
.EE
.PP
Another important consideration for efficiency is the use of programs with short startup times for preview. For this reason, 'highlight' is recommended over 'pygmentize' for syntax highlighting. Besides, it is also important that the application is processing the file on the fly rather than first reading it to the memory and then do the processing afterwards. This is especially relevant for big files. lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read. When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview.
Another important consideration for efficiency is the use of programs with short startup times for preview. For this reason, 'highlight' is recommended over 'pygmentize' for syntax highlighting. Besides, it is also important that the application is processing the file on the fly rather than first reading it to the memory and then do the processing afterwards. This is especially relevant for big files. lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read. When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview. Note that some programs may not respond well to SIGPIPE to exit with a non-zero return code and avoid caching. You may trap SIGPIPE in your preview script to avoid error propogation:
.PP
.EX
#!/bin/sh
.EE
.PP
.EX
trap "" PIPE
.EE
.PP
.EX
...
.EE
.PP
You may also use an existing preview filter as you like. Your system may already come with a preview filter named 'lesspipe'. These filters may have a mechanism to add user customizations as well. See the related documentations for more information.
.SH CHANGING DIRECTORY