Skip to content

Commit

Permalink
feat: remove space for filesize
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Jan 31, 2024
1 parent a2e2909 commit 364eac9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions filepicker/filepicker.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type readDirMsg struct {

const (
marginBottom = 5
fileSizeWidth = 8
fileSizeWidth = 7
paddingLeft = 2
)

Expand Down Expand Up @@ -377,7 +377,7 @@ func (m Model) View() string {
var symlinkPath string
info, _ := f.Info()
isSymlink := info.Mode()&os.ModeSymlink != 0
size := humanize.Bytes(uint64(info.Size()))
size := strings.Replace(humanize.Bytes(uint64(info.Size())), " ", "", 1)
name := f.Name()

if isSymlink {
Expand All @@ -392,7 +392,7 @@ func (m Model) View() string {
selected += " " + info.Mode().String()
}
if m.ShowSize {
selected += " " + fmt.Sprintf("%"+strconv.Itoa(m.Styles.FileSize.GetWidth())+"s", size)
selected += fmt.Sprintf("%"+strconv.Itoa(m.Styles.FileSize.GetWidth())+"s", size)
}
selected += " " + name
if isSymlink {
Expand Down Expand Up @@ -425,7 +425,7 @@ func (m Model) View() string {
s.WriteString(" " + m.Styles.Permission.Render(info.Mode().String()))
}
if m.ShowSize {
s.WriteString(" " + m.Styles.FileSize.Render(size))
s.WriteString(m.Styles.FileSize.Render(size))
}
s.WriteString(" " + fileName)
s.WriteRune('\n')
Expand Down

0 comments on commit 364eac9

Please sign in to comment.