File tree 3 files changed +12
-12
lines changed
3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package format
3
3
import (
4
4
"fmt"
5
5
"strings"
6
- "github.com/fatih/color"
7
6
"github.com/drn/nerd-ls/node"
8
7
"github.com/drn/nerd-ls/util"
9
8
)
@@ -64,8 +63,3 @@ func compactDisplay(nodes []node.Node, width int) {
64
63
fmt .Println ()
65
64
}
66
65
}
67
-
68
- func nodeColor (node node.Node ) * color.Color {
69
- if ! node .IsDir { return color .New (color .FgWhite ) }
70
- return color .New (color .FgCyan , color .Bold )
71
- }
Original file line number Diff line number Diff line change @@ -143,12 +143,7 @@ func colorize(mode rune, color *color.Color) string {
143
143
}
144
144
145
145
func formatName (node node.Node ) string {
146
- var baseColor * color.Color
147
- if ! node .IsDir {
148
- baseColor = color .New (color .FgWhite )
149
- } else {
150
- baseColor = color .New (color .FgCyan , color .Bold )
151
- }
146
+ baseColor := nodeColor (node )
152
147
153
148
if node .Symlink == "" { return baseColor .Sprintf (" %s" , node .Name ) }
154
149
Original file line number Diff line number Diff line change
1
+ package format
2
+
3
+ import (
4
+ "github.com/fatih/color"
5
+ "github.com/drn/nerd-ls/node"
6
+ )
7
+
8
+ func nodeColor (node node.Node ) * color.Color {
9
+ if ! node .IsDir { return color .New (color .FgWhite ) }
10
+ return color .New (color .FgCyan , color .Bold )
11
+ }
You can’t perform that action at this time.
0 commit comments