parent
b90bd273f7
commit
ef4dd12e33
1
comp.go
1
comp.go
@ -21,7 +21,6 @@ var (
|
||||
"scrolloff",
|
||||
"sortby",
|
||||
"showinfo",
|
||||
"opener",
|
||||
"ratios",
|
||||
}
|
||||
)
|
||||
|
12
eval.go
12
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()
|
||||
|
2
opts.go
2
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)
|
||||
|
Loading…
Reference in New Issue
Block a user