CribbNotes CUI v1.0

blov · 2016-08-05 11:00:11 · 612 次点击    
这是一个分享于 2016-08-05 11:00:11 的资源,其中的信息可能已经有所发展或是发生改变。

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.


入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

612 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传