Skip to content

Commit

Permalink
fix input for add note regex (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
strogiyotec authored Nov 4, 2020
1 parent 70295bf commit 465a098
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var addNoteCmd = &cobra.Command{
Long: addNoteCmdLongDesc,
Short: addNoteCmdDesc,
Run: func(cmd *cobra.Command, args []string) {
ultralist.NewApp().HandleNotes("an " + strings.Join(args, " "))
ultralist.NewApp().HandleNotes(strings.Join(args, " "))
},
}

Expand Down
10 changes: 5 additions & 5 deletions ultralist/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ func (a *App) HandleNotes(input string) {
return
}
parser := &NoteParser{}

if parser.ParseAddNote(todo, input) {
regexedInput := "an " + input
if parser.ParseAddNote(todo, regexedInput) {
fmt.Println("Note added.")
} else if parser.ParseDeleteNote(todo, input) {
} else if parser.ParseDeleteNote(todo, regexedInput) {
fmt.Println("Note deleted.")
} else if parser.ParseEditNote(todo, input) {
} else if parser.ParseEditNote(todo, regexedInput) {
fmt.Println("Note edited.")
} else if parser.ParseShowNote(todo, input) {
} else if parser.ParseShowNote(todo, regexedInput) {
groups := map[string][]*Todo{}
groups[""] = append(groups[""], todo)
a.Printer.Print(&GroupedTodos{Groups: groups}, true, true)
Expand Down

0 comments on commit 465a098

Please sign in to comment.