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!":
|
case "incsearch!":
|
||||||
gOpts.incsearch = !gOpts.incsearch
|
gOpts.incsearch = !gOpts.incsearch
|
||||||
case "preview":
|
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
|
gOpts.preview = true
|
||||||
case "nopreview":
|
case "nopreview":
|
||||||
gOpts.preview = false
|
gOpts.preview = false
|
||||||
case "preview!":
|
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
|
gOpts.preview = !gOpts.preview
|
||||||
case "reverse":
|
case "reverse":
|
||||||
gOpts.sortType.option |= reverseSort
|
gOpts.sortType.option |= reverseSort
|
||||||
|
Loading…
Reference in New Issue
Block a user