We should sync.

This commit is contained in:
2026-07-22 15:34:08 +09:30
parent 3ffb113464
commit 4b55b93285
2 changed files with 14 additions and 1 deletions
+11
View File
@@ -1 +1,12 @@
# Journal # Journal
## What is this?
Simplest possible (well, choose your own definition of "simplest") journalling system.
Run it, it drops you into an editor which lets you write. Ctrl+S to save, Ctrl+C to save
and quit.
## Install
go install code.ppl.town/justin/journal@latest
+3 -1
View File
@@ -33,6 +33,7 @@ type transientMsg struct {
type WriteSeekCloser interface { type WriteSeekCloser interface {
io.WriteSeeker io.WriteSeeker
io.Closer io.Closer
Sync() error
} }
type model struct { type model struct {
@@ -173,7 +174,8 @@ func (m model) writeFile() error {
if err != nil { if err != nil {
return fmt.Errorf("write: %w", err) return fmt.Errorf("write: %w", err)
} }
return nil
return m.fh.Sync()
} }
func (m model) View() tea.View { func (m model) View() tea.View {