From ef4dd12e3354f4279acb8219510df56b7c614646 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Thu, 25 Aug 2016 00:51:52 +0300 Subject: [PATCH] use open-file command instead of opener option Mentioned in #7. --- comp.go | 1 - eval.go | 12 ++---------- opts.go | 2 -- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/comp.go b/comp.go index cddd609..be680ac 100644 --- a/comp.go +++ b/comp.go @@ -21,7 +21,6 @@ var ( "scrolloff", "sortby", "showinfo", - "opener", "ratios", } ) diff --git a/eval.go b/eval.go index fd332bb..41e4479 100644 --- a/eval.go +++ b/eval.go @@ -79,8 +79,6 @@ func (e *SetExpr) eval(app *App, args []string) { } gOpts.sortby = e.val app.nav.renew(app.nav.height) - case "opener": - gOpts.opener = e.val case "ratios": toks := strings.Split(e.val, ":") var rats []int @@ -179,14 +177,8 @@ func (e *CallExpr) eval(app *App, args []string) { return } - if len(app.nav.marks) == 0 { - app.runShell(fmt.Sprintf("%s '%s'", gOpts.opener, path), nil, false, false) - } else { - s := gOpts.opener - for m := range app.nav.marks { - s += fmt.Sprintf(" '%s'", m) - } - app.runShell(s, nil, false, false) + if cmd, ok := gOpts.cmds["open-file"]; ok { + cmd.eval(app, e.args) } case "bot": app.nav.bot() diff --git a/opts.go b/opts.go index a5b3743..e9fe79b 100644 --- a/opts.go +++ b/opts.go @@ -8,7 +8,6 @@ type Opts struct { ifs string showinfo string sortby string - opener string ratios []int keys map[string]Expr cmds map[string]Expr @@ -24,7 +23,6 @@ func init() { gOpts.ifs = "" gOpts.showinfo = "none" gOpts.sortby = "name" - gOpts.opener = "xdg-open" gOpts.ratios = []int{1, 2, 3} gOpts.keys = make(map[string]Expr)