Skip to content

Commit

Permalink
Respect inactive cursor for empty directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Sep 11, 2022
1 parent 0b1e970 commit 9b72272
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,21 @@ func (win *win) printDir(screen tcell.Screen, dir *dir, context *dirContext, dir
return
}

messageStyle := tcell.StyleDefault.Reverse(true)
if !dirStyle.activeCursor {
messageStyle = messageStyle.Foreground(DimCursorColor)
}

if dir.noPerm {
win.print(screen, 2, 0, tcell.StyleDefault.Reverse(true), "permission denied")
win.print(screen, 2, 0, messageStyle, "permission denied")
return
}

if dir.loading && len(dir.files) == 0 {
win.print(screen, 2, 0, tcell.StyleDefault.Reverse(true), "loading...")
win.print(screen, 2, 0, messageStyle, "loading...")
return
}

if len(dir.files) == 0 {
win.print(screen, 2, 0, tcell.StyleDefault.Reverse(true), "empty")
win.print(screen, 2, 0, messageStyle, "empty")
return
}

Expand Down

0 comments on commit 9b72272

Please sign in to comment.