Fixed variable shadowing bug in ls command
This commit is contained in:
parent
fa966d30db
commit
120e61e88b
@ -258,17 +258,17 @@ var listCmd = &cobra.Command{
|
|||||||
var conversationsPrinted int
|
var conversationsPrinted int
|
||||||
outer:
|
outer:
|
||||||
for _, category := range categories {
|
for _, category := range categories {
|
||||||
conversations, ok := categorized[category.name]
|
conversationLines, ok := categorized[category.name]
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
slices.SortFunc(conversations, func(a, b ConversationLine) int {
|
slices.SortFunc(conversationLines, func(a, b ConversationLine) int {
|
||||||
return int(a.timeSinceReply - b.timeSinceReply)
|
return int(a.timeSinceReply - b.timeSinceReply)
|
||||||
})
|
})
|
||||||
|
|
||||||
fmt.Printf("%s:\n", category.name)
|
fmt.Printf("%s:\n", category.name)
|
||||||
for _, conv := range conversations {
|
for _, conv := range conversationLines {
|
||||||
if conversationsPrinted >= LS_LIMIT && !all {
|
if conversationsPrinted >= LS_LIMIT && !all {
|
||||||
fmt.Printf("%d remaining message(s), use --all to view.\n", len(conversations)-conversationsPrinted)
|
fmt.Printf("%d remaining message(s), use --all to view.\n", len(conversations)-conversationsPrinted)
|
||||||
break outer
|
break outer
|
||||||
|
Loading…
Reference in New Issue
Block a user