Hi, everyone. I would like to announce the first release of CribbNotes CUI (https://github.com/jameycribbs/cribbnotes_cui). CribbNotes CUI is a simple, console-user-interface note taking application written in Go and using the awesome gocui library.
CribbNotes CUI stores it's notes in json format for easy access outside the app. You can add new notes, edit existing notes, delete notes, and search notes. It is fairly simplistic, but I wanted to write something using gocui and I have a soft-spot for simple, text-based note apps, so here we are.
I would greatly appreciate any feedback on the app, and especially the code. I have run everything through golint and govet, but I don't yet do a lot of Go, so constructive criticism on what I can do better is welcome.
There is experimental vim support (albeit rudimentary at this point) for navigation and editing, that can be enabled by passing --vim as the last argument when running the executable. I have only tested this on linux.
Enjoy and thanks for your time!
Jamey Cribbs
评论:
i_regret_most_of_it:
I was mildly impressed by the screenshot so I went and
go get
'd it.Some suggestions:
- Don't use panic for everything
- Use flag or maybe urfave/cli so people aren't lost when they run the binary
- It doesn't work for me on Ubuntu/xfce4-terminal:
.
$ cribbnotes_cui ~/Documents/crib
panic: (PopulateToc) error on SetCursor on toc view: invalid point
goroutine 1 [running]:
panic(0x581760, 0xc820012830)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
main.main()
/home/alex/devel/go/src/github.com/jameycribbs/cribbnotes_cui/cribbnotes_cui.go:70 +0x906
Edit: so with that last panic, it seems that if I am in tmux + split pane, it craps itself. Works fine otherwise. However gocui examples work fine in the same environment, so I think you are misusing gocui somewhere.
But, there are tonnes of other panics. Such as scrolling down too far in vim mode (j j j j j) past the end of the document = panic. Again, avoid panic for ordinary errors, and prevent regular panics by doing things like bounds checks.
jameycribbs:Thanks for the feedback! I will work on the things you mentioned.
