Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Databingo committed Mar 8, 2023
1 parent 70fa4aa commit fe3d725
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Only for easily create/search/modify notes (in a single JSON file).
## Installation
```bash
$ git clone https://github.com/Databingo/jnote
$ cd jnote && go install
$ cd jnote && CGO_ENABLED=1 go install
```
## Usage
```bash
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ require (
github.com/creack/pty v1.1.18
github.com/gdamore/tcell/v2 v2.5.3
github.com/gofrs/uuid v4.4.0+incompatible
github.com/micmonay/keybd_event v1.1.1
github.com/rivo/tview v0.0.0-20230104153304-892d1a2eb0da
github.com/tidwall/gjson v1.14.2
github.com/tidwall/sjson v1.2.5
golang.org/x/crypto v0.5.0
)

Expand All @@ -15,10 +18,8 @@ require (
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/tidwall/gjson v1.14.2 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/term v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/micmonay/keybd_event v1.1.1 h1:rv7omwXWYL9Lgf3PUq6uBgJI2k1yGkL/GD6dxc6nmSs=
github.com/micmonay/keybd_event v1.1.1/go.mod h1:CGMWMDNgsfPljzrAWoybUOSKafQPZpv+rLigt2LzNGI=
github.com/rivo/tview v0.0.0-20230104153304-892d1a2eb0da h1:3Mh+tcC2KqetuHpWMurDeF+yOgyt4w4qtLIpwSQ3uqo=
github.com/rivo/tview v0.0.0-20230104153304-892d1a2eb0da/go.mod h1:lBUy/T5kyMudFzWUH/C2moN+NlU5qF505vzOyINXuUQ=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
Expand Down
16 changes: 14 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/tidwall/gjson"
"github.com/tidwall/sjson"
"golang.org/x/crypto/ssh/terminal"
"github.com/micmonay/keybd_event"
"io"
"io/ioutil"
"log"
Expand Down Expand Up @@ -547,6 +548,17 @@ func (g *Gui) EditWithEditor(t *Tree) {
log.Println("open $EDITOR failed")
return
}
defer func() {
t.Move(-1).GetCurrentNode()
t.Move(+1).GetCurrentNode()
t.SetCurrentNode(t.GetCurrentNode())
//uiBugFix, fix keystroke losing after exit edition
kb, err := keybd_event.NewKeyBonding()
if err != nil { return }
kb.SetKeys(keybd_event.VK_SPACE)
kb.Launching()
}()

defer func() {
if err := ptmx.Close(); err != nil {
log.Println("can't close pty: %s", err)
Expand Down Expand Up @@ -612,9 +624,9 @@ func (g *Gui) EditWithEditor(t *Tree) {
g.Text.SetText(texted)

//g.Save_json()
g.Save_json_2()
os.RemoveAll(f.Name())
// g.Tree.UpdateView(g, i)
g.Save_json_2()
//g.Tree.UpdateView(g, i)
//---------------------
})
}
Expand Down
23 changes: 23 additions & 0 deletions nohup.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
* Using credentials: ashahChen
* Serving Flask app "grip.app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://localhost:5973/ (Press CTRL+C to quit)
127.0.0.1 - - [05/Mar/2023 21:22:00] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [05/Mar/2023 21:22:00] "GET /__/grip/asset/github-9f1009c5473fcfa407b651513175cb55.css HTTP/1.1" 200 -
127.0.0.1 - - [05/Mar/2023 21:22:00] "GET /__/grip/asset/frameworks-02a3eaa24db2bd1ed9b64450595fc2cf.css HTTP/1.1" 200 -
127.0.0.1 - - [05/Mar/2023 21:22:00] "GET /__/grip/asset/site-889ba3896abfbcb8742b625020c44299.css HTTP/1.1" 200 -
127.0.0.1 - - [05/Mar/2023 21:22:00] "GET /__/grip/static/octicons/octicons.css HTTP/1.1" 200 -
127.0.0.1 - - [05/Mar/2023 21:22:01] "GET /jnote2.gif HTTP/1.1" 200 -
127.0.0.1 - - [05/Mar/2023 21:22:01] "GET /__/grip/static/favicon.ico HTTP/1.1" 200 -
127.0.0.1 - - [05/Mar/2023 21:22:01] "GET /__/grip/static/octicons/octicons.woff2?ef21c39f0ca9b1b5116e5eb7ac5eabe6 HTTP/1.1" 200 -
* Using credentials: ashahChen
* Serving Flask app "grip.app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://localhost:3781/ (Press CTRL+C to quit)
127.0.0.1 - - [05/Mar/2023 21:23:07] "GET / HTTP/1.1" 200 -

0 comments on commit fe3d725

Please sign in to comment.