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:
parent
f356e6d694
commit
8d4a3192f1
2
ui.go
2
ui.go
@ -257,7 +257,7 @@ func (win *Win) printr(reg *os.File) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(gOpts.previewer) != 0 {
|
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()
|
out, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user