Cleanup (#2065)
This commit is contained in:
1 parent
ab662e6f33
commit
46cc577d4a
2 files changed
+18
-16
No files matched your search
+4
-4
@@ -348,10 +348,10 @@ func completeCmd(acc []rune) (matches []string, longestAcc []rune) {
|
||||
case "selmode":
|
||||
matches, longest = matchWord(f[2], []string{"all", "dir"})
|
||||
case "sortby":
|
||||
matches, longest = matchWord(f[2], []string{"natural", "name", "size", "time", "atime", "btime", "ctime", "ext", "custom"})
|
||||
matches, longest = matchWord(f[2], []string{"atime", "btime", "ctime", "custom", "ext", "name", "natural", "size", "time"})
|
||||
default:
|
||||
if slices.Contains(gOptWords, f[1]+"!") {
|
||||
matches, longest = matchWord(f[2], []string{"true", "false"})
|
||||
matches, longest = matchWord(f[2], []string{"false", "true"})
|
||||
}
|
||||
}
|
||||
case "setlocal":
|
||||
@@ -368,10 +368,10 @@ func completeCmd(acc []rune) (matches []string, longestAcc []rune) {
|
||||
}
|
||||
switch f[2] {
|
||||
case "sortby":
|
||||
matches, longest = matchWord(f[3], []string{"natural", "name", "size", "time", "atime", "btime", "ctime", "ext", "custom"})
|
||||
matches, longest = matchWord(f[3], []string{"atime", "btime", "ctime", "custom", "ext", "name", "natural", "size", "time"})
|
||||
default:
|
||||
if slices.Contains(gLocalOptWords, f[2]+"!") {
|
||||
matches, longest = matchWord(f[3], []string{"true", "false"})
|
||||
matches, longest = matchWord(f[3], []string{"false", "true"})
|
||||
}
|
||||
}
|
||||
case "map", "nmap", "vmap", "cmap":
|
||||
|
||||
@@ -98,20 +98,10 @@ func (e *setExpr) eval(app *app, args []string) {
|
||||
}
|
||||
app.ui.loadFile(app, true)
|
||||
}
|
||||
case "filtermethod":
|
||||
switch e.val {
|
||||
case "text", "glob", "regex":
|
||||
gOpts.filtermethod = searchMethod(e.val)
|
||||
default:
|
||||
app.ui.echoerr("filtermethod: value should either be 'text', 'glob' or 'regex")
|
||||
return
|
||||
}
|
||||
app.nav.sort()
|
||||
app.nav.position()
|
||||
app.ui.sort()
|
||||
app.ui.loadFile(app, true)
|
||||
// DEPRECATED: remove after r37 is released
|
||||
case "globfilter", "noglobfilter", "globfilter!":
|
||||
app.ui.echoerr("option 'globfilter' is deprecated, use 'filtermethod' instead")
|
||||
// DEPRECATED: remove after r37 is released
|
||||
case "globsearch", "noglobsearch", "globsearch!":
|
||||
app.ui.echoerr("option 'globsearch' is deprecated, use 'searchmethod' instead")
|
||||
case "hidden", "nohidden", "hidden!":
|
||||
@@ -239,6 +229,18 @@ func (e *setExpr) eval(app *app, args []string) {
|
||||
gOpts.errorfmt = e.val
|
||||
case "filesep":
|
||||
gOpts.filesep = e.val
|
||||
case "filtermethod":
|
||||
switch e.val {
|
||||
case "text", "glob", "regex":
|
||||
gOpts.filtermethod = searchMethod(e.val)
|
||||
default:
|
||||
app.ui.echoerr("filtermethod: value should either be 'text', 'glob' or 'regex")
|
||||
return
|
||||
}
|
||||
app.nav.sort()
|
||||
app.nav.position()
|
||||
app.ui.sort()
|
||||
app.ui.loadFile(app, true)
|
||||
case "findlen":
|
||||
n, err := strconv.Atoi(e.val)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user