mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
Set ID of newly stashed markdowns so we can operate on them
This commit is contained in:
parent
d9b1d335d4
commit
5bdf7649b0
4 changed files with 13 additions and 8 deletions
4
go.mod
4
go.mod
|
@ -6,7 +6,7 @@ require (
|
|||
github.com/alecthomas/chroma v0.8.0 // indirect
|
||||
github.com/charmbracelet/bubbles v0.5.2-0.20200820173131-d4a0ecd3ee70
|
||||
github.com/charmbracelet/bubbletea v0.10.3
|
||||
github.com/charmbracelet/charm v0.7.1-0.20200821004146-148a655040c4
|
||||
github.com/charmbracelet/charm v0.7.1-0.20200821194648-662b3ca6fc7e
|
||||
github.com/charmbracelet/glamour v0.2.1-0.20200820173154-593dda41c59f
|
||||
github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac
|
||||
github.com/mattn/go-runewidth v0.0.9
|
||||
|
@ -19,5 +19,5 @@ require (
|
|||
github.com/yuin/goldmark v1.2.1 // indirect
|
||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
|
||||
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc // indirect
|
||||
golang.org/x/sys v0.0.0-20200820212457-1fb795427249
|
||||
golang.org/x/sys v0.0.0-20200821140526-fda516888d29
|
||||
)
|
||||
|
|
8
go.sum
8
go.sum
|
@ -26,8 +26,8 @@ github.com/charmbracelet/bubbles v0.5.2-0.20200820173131-d4a0ecd3ee70/go.mod h1:
|
|||
github.com/charmbracelet/bubbletea v0.9.1-0.20200713153904-2f53eeb54b90/go.mod h1:wjGGC5pyYvpuls0so+w4Zv+aZQW7RoPvsi9UBcDlSl8=
|
||||
github.com/charmbracelet/bubbletea v0.10.3 h1:arYCVde6OHbejtz08VOtAjsw4LlMR9pQhJCkqk3bwr8=
|
||||
github.com/charmbracelet/bubbletea v0.10.3/go.mod h1:fB1bVmlaXBYYv4G0jtuGSP/m8V2sMM97pq7QqQnubWI=
|
||||
github.com/charmbracelet/charm v0.7.1-0.20200821004146-148a655040c4 h1:JguzG6Hoy4qyxQeyAA4e1yQfRnBSxEMWn5CL8ATXc5o=
|
||||
github.com/charmbracelet/charm v0.7.1-0.20200821004146-148a655040c4/go.mod h1:kBWrZbEyxepjFthay19UTRNslbk8LkycGIFwR822Kvg=
|
||||
github.com/charmbracelet/charm v0.7.1-0.20200821194648-662b3ca6fc7e h1:3XtR0wWJVWCKiwt4acKh375nRmkuPYae6y8RsweS3AE=
|
||||
github.com/charmbracelet/charm v0.7.1-0.20200821194648-662b3ca6fc7e/go.mod h1:kBWrZbEyxepjFthay19UTRNslbk8LkycGIFwR822Kvg=
|
||||
github.com/charmbracelet/glamour v0.2.1-0.20200820173154-593dda41c59f h1:VXwz/CsPDsrqUzQhp0eOB7VviujsiWKX/3H9cJOiHqc=
|
||||
github.com/charmbracelet/glamour v0.2.1-0.20200820173154-593dda41c59f/go.mod h1:DxzK1feHER8JTrWJ4uhme1kTGs4/ozEoQhIyYzwnew0=
|
||||
github.com/chris-ramon/douceur v0.2.0 h1:IDMEdxlEUUBYBKE4z/mJnFyVXox+MjuEVDJNN27glkU=
|
||||
|
@ -210,8 +210,8 @@ golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200819171115-d785dc25833f h1:KJuwZVtZBVzDmEDtB2zro9CXkD9O0dpCv4o2LHbQIAw=
|
||||
golang.org/x/sys v0.0.0-20200819171115-d785dc25833f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200820212457-1fb795427249 h1:tKP05IMsVLZ4VeeCEFmrIUmxAAx6UD8IBdPtYlYNa8g=
|
||||
golang.org/x/sys v0.0.0-20200820212457-1fb795427249/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200821140526-fda516888d29 h1:mNuhGagCf3lDDm5C0376C/sxh6V7fy9WbdEu/YDNA04=
|
||||
golang.org/x/sys v0.0.0-20200821140526-fda516888d29/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
|
|
2
stash.go
2
stash.go
|
@ -36,7 +36,7 @@ var (
|
|||
if err != nil {
|
||||
return fmt.Errorf("error reading file")
|
||||
}
|
||||
err = cc.StashMarkdown(memo, string(b))
|
||||
_, err = cc.StashMarkdown(memo, string(b))
|
||||
if err != nil {
|
||||
return fmt.Errorf("error stashing markdown")
|
||||
}
|
||||
|
|
|
@ -475,13 +475,18 @@ func stashDocument(cc *charm.Client, md markdown) tea.Cmd {
|
|||
md.localPath = ""
|
||||
|
||||
return func() tea.Msg {
|
||||
err := cc.StashMarkdown(md.Note, md.Body)
|
||||
newMd, err := cc.StashMarkdown(md.Note, md.Body)
|
||||
if err != nil {
|
||||
if debug {
|
||||
log.Println("error stashing document:", err)
|
||||
}
|
||||
return errMsg(err)
|
||||
}
|
||||
|
||||
// We really just need to know the ID so we can operate on this newly
|
||||
// stashed markdown.
|
||||
md.ID = newMd.ID
|
||||
|
||||
return stashSuccessMsg(md)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue