Skip to content

Commit

Permalink
Fix number creation when its bigger than 10
Browse files Browse the repository at this point in the history
Closes #15
  • Loading branch information
gumieri committed Aug 27, 2018
1 parent 33a961d commit 9a4a066
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/notes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ func ExistingNames(notePath string) (notesNames []string, err error) {
return
}

sort.Slice(list, func(a, b int) bool { return list[a].Name() < list[b].Name() })
sort.Slice(list, func(a, b int) bool {
return NumberFromNoteName(list[a].Name()) < NumberFromNoteName(list[b].Name())
})

for _, file := range list {
if noteRegex.MatchString(file.Name()) {
Expand Down

0 comments on commit 9a4a066

Please sign in to comment.