parent
784d80ca30
commit
8bc975a858
3
comp.go
3
comp.go
@ -59,6 +59,9 @@ var (
|
||||
"reverse",
|
||||
"noreverse",
|
||||
"reverse!",
|
||||
"wrapscan",
|
||||
"nowrapscan",
|
||||
"wrapscan!",
|
||||
"scrolloff",
|
||||
"tabstop",
|
||||
"filesep",
|
||||
|
1
doc.go
1
doc.go
@ -70,6 +70,7 @@ The following options can be used to customize the behavior of lf:
|
||||
hidden boolean (default off)
|
||||
preview boolean (default on)
|
||||
reverse boolean (default off)
|
||||
wrapscan boolean (default on)
|
||||
scrolloff integer (default 0)
|
||||
tabstop integer (default 8)
|
||||
filesep string (default ":")
|
||||
|
@ -74,6 +74,7 @@ The following options can be used to customize the behavior of lf:
|
||||
hidden boolean (default off)
|
||||
preview boolean (default on)
|
||||
reverse boolean (default off)
|
||||
wrapscan boolean (default on)
|
||||
scrolloff integer (default 0)
|
||||
tabstop integer (default 8)
|
||||
filesep string (default ":")
|
||||
|
6
eval.go
6
eval.go
@ -44,6 +44,12 @@ func (e *setExpr) eval(app *app, args []string) {
|
||||
case "reverse!":
|
||||
gOpts.reverse = !gOpts.reverse
|
||||
app.nav.renew(app.nav.height)
|
||||
case "wrapscan":
|
||||
gOpts.wrapscan = true
|
||||
case "nowrapscan":
|
||||
gOpts.wrapscan = false
|
||||
case "wrapscan!":
|
||||
gOpts.wrapscan = !gOpts.wrapscan
|
||||
case "scrolloff":
|
||||
n, err := strconv.Atoi(e.val)
|
||||
if err != nil {
|
||||
|
4
nav.go
4
nav.go
@ -372,12 +372,14 @@ func (nav *nav) searchNext() {
|
||||
return
|
||||
}
|
||||
}
|
||||
if gOpts.wrapscan {
|
||||
for i := 0; i < last.ind; i++ {
|
||||
if strings.Contains(last.fi[i].Name(), nav.search) {
|
||||
nav.up(last.ind - i)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (nav *nav) searchPrev() {
|
||||
@ -388,12 +390,14 @@ func (nav *nav) searchPrev() {
|
||||
return
|
||||
}
|
||||
}
|
||||
if gOpts.wrapscan {
|
||||
for i := len(last.fi) - 1; i > last.ind; i-- {
|
||||
if strings.Contains(last.fi[i].Name(), nav.search) {
|
||||
nav.down(i - last.ind)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (nav *nav) toggleMark(path string) {
|
||||
|
2
opts.go
2
opts.go
@ -7,6 +7,7 @@ var gOpts struct {
|
||||
hidden bool
|
||||
preview bool
|
||||
reverse bool
|
||||
wrapscan bool
|
||||
scrolloff int
|
||||
tabstop int
|
||||
filesep string
|
||||
@ -27,6 +28,7 @@ func init() {
|
||||
gOpts.hidden = false
|
||||
gOpts.preview = true
|
||||
gOpts.reverse = false
|
||||
gOpts.wrapscan = true
|
||||
gOpts.scrolloff = 0
|
||||
gOpts.tabstop = 8
|
||||
gOpts.filesep = ":"
|
||||
|
Loading…
Reference in New Issue
Block a user