Pass width and height to the previewer
This way, the script can do a little magic like
head -n $2 $1 | highlight -O ansi --syntax ${1##*.}
to avoid reading whole (possibly huge) file.
This commit is contained in:
1 parent
f356e6d694
commit
8d4a3192f1
1 file changed
+1
-1
@@ -257,7 +257,7 @@ func (win *Win) printr(reg *os.File) error {
|
||||
}
|
||||
|
||||
if len(gOpts.previewer) != 0 {
|
||||
cmd := exec.Command(gOpts.previewer, reg.Name())
|
||||
cmd := exec.Command(gOpts.previewer, reg.Name(), strconv.Itoa(win.w), strconv.Itoa(win.h))
|
||||
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user