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:
KenjiTakahashi committed 2016-09-01 00:19:08 +02:00
1 parent f356e6d694
commit 8d4a3192f1
1 file changed
+1 -1
+1 -1
View File
@@ -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 {