Fixed variable shadowing bug in ls command

This commit is contained in:
Matt Low 2024-02-22 05:00:03 +00:00
parent fa966d30db
commit 120e61e88b

View File

@ -258,17 +258,17 @@ var listCmd = &cobra.Command{
var conversationsPrinted int
outer:
for _, category := range categories {
conversations, ok := categorized[category.name]
conversationLines, ok := categorized[category.name]
if !ok {
continue
}
slices.SortFunc(conversations, func(a, b ConversationLine) int {
slices.SortFunc(conversationLines, func(a, b ConversationLine) int {
return int(a.timeSinceReply - b.timeSinceReply)
})
fmt.Printf("%s:\n", category.name)
for _, conv := range conversations {
for _, conv := range conversationLines {
if conversationsPrinted >= LS_LIMIT && !all {
fmt.Printf("%d remaining message(s), use --all to view.\n", len(conversations)-conversationsPrinted)
break outer