persistSplitDiffView writes the current split-diff toggle to the user config without blocking the UI. Errors are logged but otherwise ignored because losing the persistence is non-fatal.
(enabled bool)
| 424 | // config without blocking the UI. Errors are logged but otherwise ignored |
| 425 | // because losing the persistence is non-fatal. |
| 426 | func persistSplitDiffView(enabled bool) { |
| 427 | cfg, err := userconfig.Load() |
| 428 | if err != nil { |
| 429 | slog.Warn("Failed to load userconfig for split diff toggle", "error", err) |
| 430 | return |
| 431 | } |
| 432 | if cfg.Settings == nil { |
| 433 | cfg.Settings = &userconfig.Settings{} |
| 434 | } |
| 435 | cfg.Settings.SplitDiffView = &enabled |
| 436 | if err := cfg.Save(); err != nil { |
| 437 | slog.Warn("Failed to persist split diff setting to userconfig", "error", err) |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | // --- Dialogs --- |
| 442 |
no test coverage detected