add 'setlocal' for directory specific options (#1381)

* add 'setlocal' for option 'sortby'

* save each local option separately

* add 'setlocal' for option 'reverse'

* add 'setlocal' for option 'dirfirst'

* add 'setlocal' for option 'hidden'

* add 'setlocal' for option 'dironly'

* add 'setlocal' for option 'info'

* add boolean toggling for 'setlocal' options

* check if the path is absolute for 'setlocal'

* add 'setlocal' options to completion

* add tests for 'setlocal'

* add 'setlocal' to the documentation

* use trailing '/' in 'setlocal' for subdir matching

* cleanup

* add 'setlocal' subdirs to the documentation
This commit is contained in:
Gökçehan Kara authored and GitHub committed 2023-09-02 22:22:56 +03:00
1 parent 990cea7e04
commit 8d013c9375
10 files changed
+486 -31

No files matched your search

+5 -5
View File
@@ -210,8 +210,8 @@ func normalize(s1, s2 string, ignorecase, ignoredia bool) (string, string) {
}
func (dir *dir) sort() {
dir.sortType = gOpts.sortType
dir.dironly = gOpts.dironly
dir.sortType = getSortType(dir.path)
dir.dironly = getDirOnly(dir.path)
dir.hiddenfiles = gOpts.hiddenfiles
dir.ignorecase = gOpts.ignorecase
dir.ignoredia = gOpts.ignoredia
@@ -472,7 +472,7 @@ func (nav *nav) loadDirInternal(path string) *dir {
loading: true,
loadTime: time.Now(),
path: path,
sortType: gOpts.sortType,
sortType: getSortType(path),
hiddenfiles: gOpts.hiddenfiles,
ignorecase: gOpts.ignorecase,
ignoredia: gOpts.ignoredia,
@@ -535,8 +535,8 @@ func (nav *nav) checkDir(dir *dir) {
}
nav.dirChan <- nd
}()
case dir.sortType != gOpts.sortType ||
dir.dironly != gOpts.dironly ||
case dir.sortType != getSortType(dir.path) ||
dir.dironly != getDirOnly(dir.path) ||
!reflect.DeepEqual(dir.hiddenfiles, gOpts.hiddenfiles) ||
dir.ignorecase != gOpts.ignorecase ||
dir.ignoredia != gOpts.ignoredia: