Persist undo/redo history across runs with a 20-entry cap.
Serialize create/update/delete commands to DataDir/history.json and reload them on startup via OpenHistory. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -48,7 +48,10 @@ func run() error {
|
||||
return fmt.Errorf("ensure project: %w", err)
|
||||
}
|
||||
|
||||
history := command.NewHistory()
|
||||
history, err := command.OpenHistory(command.HistoryPath(cfg.DataDir), store)
|
||||
if err != nil {
|
||||
return fmt.Errorf("history: %w", err)
|
||||
}
|
||||
model := ui.New(cfg, store, projects, history)
|
||||
prog := tea.NewProgram(model, tea.WithAltScreen())
|
||||
if _, err := prog.Run(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user