use open-file command instead of opener option

Mentioned in #7.
This commit is contained in:
Gokcehan 2016-08-25 00:51:52 +03:00
parent b90bd273f7
commit ef4dd12e33
3 changed files with 2 additions and 13 deletions

View File

@ -21,7 +21,6 @@ var (
"scrolloff",
"sortby",
"showinfo",
"opener",
"ratios",
}
)

12
eval.go
View File

@ -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()

View File

@ -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)