From 8d4a3192f1636e5bbca8039fffedb5227a739612 Mon Sep 17 00:00:00 2001 From: KenjiTakahashi Date: Wed, 31 Aug 2016 20:46:35 +0200 Subject: [PATCH] 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. --- ui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui.go b/ui.go index 45ceb64..85fb24e 100644 --- a/ui.go +++ b/ui.go @@ -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 {