We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e6f171 commit e23d335Copy full SHA for e23d335
node/root.go
@@ -5,6 +5,7 @@ import (
5
"github.com/drn/nerd-ls/icon"
6
"os"
7
"os/user"
8
+ "path/filepath"
9
"syscall"
10
"time"
11
)
@@ -58,7 +59,14 @@ func name(file os.FileInfo) string {
58
59
if !file.IsDir() {
60
return file.Name()
61
}
- return fmt.Sprintf("%s/", file.Name())
62
+ name := fmt.Sprintf("%s/", file.Name())
63
+ // inject name for current and parent directories
64
+ // TODO: properly inject names for non-current directories
65
+ if file.Name() == "." || file.Name() == ".." {
66
+ fullpath, _ := filepath.Abs(file.Name())
67
+ name = fmt.Sprintf("%s [%s]", name, filepath.Base(fullpath))
68
+ }
69
+ return name
70
71
72
func fetchIcon(file os.FileInfo) rune {
0 commit comments