File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ type TaskPrefix string
70
70
func (t Task ) Prefix () (TaskPrefix , bool ) {
71
71
summEls := strings .Split (t .Summary , PrefixDelimiter )
72
72
if len (summEls ) > 1 {
73
+ // This shouldn't happen, but it's still good to check this to ensure
74
+ // the quick filter list doesn't misbehave
75
+ if strings .TrimSpace (summEls [0 ]) == "" {
76
+ return "" , false
77
+ }
73
78
return TaskPrefix (strings .TrimSpace (summEls [0 ])), true
74
79
}
75
80
return "" , false
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package ui
2
2
3
3
import (
4
4
"fmt"
5
- "log"
6
5
"os"
7
6
"sort"
8
7
"strings"
@@ -32,7 +31,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
32
31
if m .activeView == taskListView || m .activeView == archivedTaskListView {
33
32
switch msg := msg .(type ) {
34
33
case tea.KeyMsg :
35
- log .Printf ("msg: %#v\n " , msg )
36
34
if m .taskList .FilterState () == list .Filtering {
37
35
m .taskList , cmd = m .taskList .Update (msg )
38
36
cmds = append (cmds , cmd )
@@ -152,7 +150,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
152
150
}
153
151
154
152
case tea.KeyMsg :
155
- log .Printf ("msg: %#v\n " , msg )
156
153
switch keypress := msg .String (); keypress {
157
154
158
155
case "Q" :
@@ -566,7 +563,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
566
563
t , ok := li .(types.Task )
567
564
if ok {
568
565
prefix , pOk := t .Prefix ()
569
- if pOk && prefix != "" {
566
+ if pOk {
570
567
taskPrefixes [prefix ] = struct {}{}
571
568
}
572
569
}
You can’t perform that action at this time.
0 commit comments