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