1 parent
1e94f4533e
commit
bfa527fcea
5 files changed
+98
-59
No files matched your search
@@ -233,22 +233,6 @@ func (sm styleMap) get(f *file) tcell.Style {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := sm[f.Name()]; ok {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
if val, ok := sm[f.Name()]; ok {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
if val, ok := sm[filepath.Base(f.Name())+".*"]; ok {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
if val, ok := sm["*"+f.ext]; ok {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
var key string
|
var key string
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
@@ -278,13 +262,27 @@ func (sm styleMap) get(f *file) tcell.Style {
|
|||||||
key = "sg"
|
key = "sg"
|
||||||
case f.Mode()&0111 != 0:
|
case f.Mode()&0111 != 0:
|
||||||
key = "ex"
|
key = "ex"
|
||||||
default:
|
|
||||||
key = "fi"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := sm[key]; ok {
|
if val, ok := sm[key]; ok {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if val, ok := sm[f.Name()]; ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
if val, ok := sm[filepath.Base(f.Name())+".*"]; ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
if val, ok := sm["*"+f.ext]; ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
if val, ok := sm["fi"]; ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
return tcell.StyleDefault
|
return tcell.StyleDefault
|
||||||
}
|
}
|
||||||
@@ -1241,19 +1241,31 @@ The full order of matchings from most specific to least are as follows:
|
|||||||
|
|
||||||
1. Full Path (e.g. '~/.config/lf/lfrc')
|
1. Full Path (e.g. '~/.config/lf/lfrc')
|
||||||
2. Dir Name (e.g. '.git/') (only matches dirs with a trailing slash at the end)
|
2. Dir Name (e.g. '.git/') (only matches dirs with a trailing slash at the end)
|
||||||
3. File Name (e.g. '.git')
|
3. File Type (e.g. 'ln') (except 'fi')
|
||||||
4. Base Name (e.g. 'README.*')
|
4. File Name (e.g. '.git')
|
||||||
5. Extension (e.g. '*.txt')
|
5. Base Name (e.g. 'README.*')
|
||||||
6. File Type (e.g. 'ln')
|
6. Extension (e.g. '*.txt')
|
||||||
|
7. Default (i.e. 'fi')
|
||||||
|
|
||||||
For example, given a regular text file '/path/to/README.txt', the following entries are checked in the configuration and the first one to match is used:
|
For example, given a regular text file '/path/to/README.txt', the following entries are checked in the configuration and the first one to match is used:
|
||||||
|
|
||||||
1. '/path/to/README.txt'
|
1. '/path/to/README.txt'
|
||||||
2. 'README.txt/' (skipped since the file is not a directory)
|
2. (skipped since the file is not a directory)
|
||||||
3. 'README.txt'
|
3. (skipped since the file is of type 'fi')
|
||||||
4. 'README.*'
|
4. 'README.txt'
|
||||||
5. '*.txt'
|
5. 'README.*'
|
||||||
6. 'fi'
|
6. '*.txt'
|
||||||
|
7. 'fi'
|
||||||
|
|
||||||
|
Given a regular directory '/path/to/example.d', the following entries are checked in the configuration and the first one to match is used:
|
||||||
|
|
||||||
|
1. '/path/to/example.d'
|
||||||
|
2. 'example.d/'
|
||||||
|
3. 'di'
|
||||||
|
4. 'example.d'
|
||||||
|
5. 'example.*'
|
||||||
|
6. '*.d'
|
||||||
|
7. 'fi'
|
||||||
|
|
||||||
Note that glob-like patterns do not actually perform glob matching due to performance reasons.
|
Note that glob-like patterns do not actually perform glob matching due to performance reasons.
|
||||||
|
|
||||||
|
|||||||
+22
-9
@@ -1400,20 +1400,33 @@ follows:
|
|||||||
|
|
||||||
1. Full Path (e.g. '~/.config/lf/lfrc')
|
1. Full Path (e.g. '~/.config/lf/lfrc')
|
||||||
2. Dir Name (e.g. '.git/') (only matches dirs with a trailing slash at the end)
|
2. Dir Name (e.g. '.git/') (only matches dirs with a trailing slash at the end)
|
||||||
3. File Name (e.g. '.git')
|
3. File Type (e.g. 'ln') (except 'fi')
|
||||||
4. Base Name (e.g. 'README.*')
|
4. File Name (e.g. '.git')
|
||||||
5. Extension (e.g. '*.txt')
|
5. Base Name (e.g. 'README.*')
|
||||||
6. File Type (e.g. 'ln')
|
6. Extension (e.g. '*.txt')
|
||||||
|
7. Default (i.e. 'fi')
|
||||||
|
|
||||||
For example, given a regular text file '/path/to/README.txt', the following
|
For example, given a regular text file '/path/to/README.txt', the following
|
||||||
entries are checked in the configuration and the first one to match is used:
|
entries are checked in the configuration and the first one to match is used:
|
||||||
|
|
||||||
1. '/path/to/README.txt'
|
1. '/path/to/README.txt'
|
||||||
2. 'README.txt/' (skipped since the file is not a directory)
|
2. (skipped since the file is not a directory)
|
||||||
3. 'README.txt'
|
3. (skipped since the file is of type 'fi')
|
||||||
4. 'README.*'
|
4. 'README.txt'
|
||||||
5. '*.txt'
|
5. 'README.*'
|
||||||
6. 'fi'
|
6. '*.txt'
|
||||||
|
7. 'fi'
|
||||||
|
|
||||||
|
Given a regular directory '/path/to/example.d', the following entries are
|
||||||
|
checked in the configuration and the first one to match is used:
|
||||||
|
|
||||||
|
1. '/path/to/example.d'
|
||||||
|
2. 'example.d/'
|
||||||
|
3. 'di'
|
||||||
|
4. 'example.d'
|
||||||
|
5. 'example.*'
|
||||||
|
6. '*.d'
|
||||||
|
7. 'fi'
|
||||||
|
|
||||||
Note that glob-like patterns do not actually perform glob matching due to
|
Note that glob-like patterns do not actually perform glob matching due to
|
||||||
performance reasons.
|
performance reasons.
|
||||||
|
|||||||
@@ -74,18 +74,6 @@ func (im iconMap) get(f *file) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := im[f.Name()]; ok {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
if val, ok := im[filepath.Base(f.Name())+".*"]; ok {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
if val, ok := im["*"+f.ext]; ok {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
var key string
|
var key string
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
@@ -115,13 +103,27 @@ func (im iconMap) get(f *file) string {
|
|||||||
key = "sg"
|
key = "sg"
|
||||||
case f.Mode()&0111 != 0:
|
case f.Mode()&0111 != 0:
|
||||||
key = "ex"
|
key = "ex"
|
||||||
default:
|
|
||||||
key = "fi"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := im[key]; ok {
|
if val, ok := im[key]; ok {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if val, ok := im[f.Name()]; ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
if val, ok := im[filepath.Base(f.Name())+".*"]; ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
if val, ok := im["*"+f.ext]; ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
if val, ok := im["fi"]; ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
return " "
|
return " "
|
||||||
}
|
}
|
||||||
@@ -1341,21 +1341,35 @@ Note that, lf first tries matching file names and then falls back to file types.
|
|||||||
.EX
|
.EX
|
||||||
1. Full Path (e.g. '~/.config/lf/lfrc')
|
1. Full Path (e.g. '~/.config/lf/lfrc')
|
||||||
2. Dir Name (e.g. '.git/') (only matches dirs with a trailing slash at the end)
|
2. Dir Name (e.g. '.git/') (only matches dirs with a trailing slash at the end)
|
||||||
3. File Name (e.g. '.git')
|
3. File Type (e.g. 'ln') (except 'fi')
|
||||||
4. Base Name (e.g. 'README.*')
|
4. File Name (e.g. '.git')
|
||||||
5. Extension (e.g. '*.txt')
|
5. Base Name (e.g. 'README.*')
|
||||||
6. File Type (e.g. 'ln')
|
6. Extension (e.g. '*.txt')
|
||||||
|
7. Default (i.e. 'fi')
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
For example, given a regular text file '/path/to/README.txt', the following entries are checked in the configuration and the first one to match is used:
|
For example, given a regular text file '/path/to/README.txt', the following entries are checked in the configuration and the first one to match is used:
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
1. '/path/to/README.txt'
|
1. '/path/to/README.txt'
|
||||||
2. 'README.txt/' (skipped since the file is not a directory)
|
2. (skipped since the file is not a directory)
|
||||||
3. 'README.txt'
|
3. (skipped since the file is of type 'fi')
|
||||||
4. 'README.*'
|
4. 'README.txt'
|
||||||
5. '*.txt'
|
5. 'README.*'
|
||||||
6. 'fi'
|
6. '*.txt'
|
||||||
|
7. 'fi'
|
||||||
|
.EE
|
||||||
|
.PP
|
||||||
|
Given a regular directory '/path/to/example.d', the following entries are checked in the configuration and the first one to match is used:
|
||||||
|
.PP
|
||||||
|
.EX
|
||||||
|
1. '/path/to/example.d'
|
||||||
|
2. 'example.d/'
|
||||||
|
3. 'di'
|
||||||
|
4. 'example.d'
|
||||||
|
5. 'example.*'
|
||||||
|
6. '*.d'
|
||||||
|
7. 'fi'
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
Note that glob-like patterns do not actually perform glob matching due to performance reasons.
|
Note that glob-like patterns do not actually perform glob matching due to performance reasons.
|
||||||
|
|||||||
Reference in new issue
Block a user