parent
9e69ce94ca
commit
ca7a3ccab4
3
comp.go
3
comp.go
@ -59,6 +59,9 @@ var (
|
||||
"hidden",
|
||||
"nohidden",
|
||||
"hidden!",
|
||||
"ignorecase",
|
||||
"noignorecase",
|
||||
"ignorecase!",
|
||||
"preview",
|
||||
"nopreview",
|
||||
"preview!",
|
||||
|
1
doc.go
1
doc.go
@ -72,6 +72,7 @@ The following options can be used to customize the behavior of lf:
|
||||
dirfirst boolean (default on)
|
||||
globsearch boolean (default off)
|
||||
hidden boolean (default off)
|
||||
ignorecase boolean (default off)
|
||||
preview boolean (default on)
|
||||
reverse boolean (default off)
|
||||
wrapscan boolean (default on)
|
||||
|
@ -76,6 +76,7 @@ The following options can be used to customize the behavior of lf:
|
||||
dirfirst boolean (default on)
|
||||
globsearch boolean (default off)
|
||||
hidden boolean (default off)
|
||||
ignorecase boolean (default off)
|
||||
preview boolean (default on)
|
||||
reverse boolean (default off)
|
||||
wrapscan boolean (default on)
|
||||
|
6
eval.go
6
eval.go
@ -41,6 +41,12 @@ func (e *setExpr) eval(app *app, args []string) {
|
||||
case "hidden!":
|
||||
gOpts.hidden = !gOpts.hidden
|
||||
app.nav.renew(app.nav.height)
|
||||
case "ignorecase":
|
||||
gOpts.ignorecase = true
|
||||
case "noignorecase":
|
||||
gOpts.ignorecase = false
|
||||
case "ignorecase!":
|
||||
gOpts.ignorecase = !gOpts.ignorecase
|
||||
case "preview":
|
||||
gOpts.preview = true
|
||||
case "nopreview":
|
||||
|
3
nav.go
3
nav.go
@ -369,6 +369,9 @@ func (nav *nav) cd(wd string) error {
|
||||
}
|
||||
|
||||
func match(pattern, name string) (matched bool, err error) {
|
||||
if gOpts.ignorecase {
|
||||
pattern, name = strings.ToLower(pattern), strings.ToLower(name)
|
||||
}
|
||||
if gOpts.globsearch {
|
||||
return filepath.Match(pattern, name)
|
||||
} else {
|
||||
|
2
opts.go
2
opts.go
@ -7,6 +7,7 @@ var gOpts struct {
|
||||
dirfirst bool
|
||||
globsearch bool
|
||||
hidden bool
|
||||
ignorecase bool
|
||||
preview bool
|
||||
reverse bool
|
||||
wrapscan bool
|
||||
@ -30,6 +31,7 @@ func init() {
|
||||
gOpts.dirfirst = true
|
||||
gOpts.globsearch = false
|
||||
gOpts.hidden = false
|
||||
gOpts.ignorecase = false
|
||||
gOpts.preview = true
|
||||
gOpts.reverse = false
|
||||
gOpts.wrapscan = true
|
||||
|
Loading…
Reference in New Issue
Block a user