Check ratios before enabling preview (#174)
This commit is contained in:
parent
34f39f90b2
commit
eb8e516cfb
8
eval.go
8
eval.go
@ -108,10 +108,18 @@ func (e *setExpr) eval(app *app, args []string) {
|
||||
case "incsearch!":
|
||||
gOpts.incsearch = !gOpts.incsearch
|
||||
case "preview":
|
||||
if len(gOpts.ratios) < 2 {
|
||||
app.ui.echoerr("preview: 'ratios' should consist of at least two numbers before enabling 'preview'")
|
||||
return
|
||||
}
|
||||
gOpts.preview = true
|
||||
case "nopreview":
|
||||
gOpts.preview = false
|
||||
case "preview!":
|
||||
if len(gOpts.ratios) < 2 {
|
||||
app.ui.echoerr("preview: 'ratios' should consist of at least two numbers before enabling 'preview'")
|
||||
return
|
||||
}
|
||||
gOpts.preview = !gOpts.preview
|
||||
case "reverse":
|
||||
gOpts.sortType.option |= reverseSort
|
||||
|
Loading…
Reference in New Issue
Block a user