handleThemeFileChanged hot-reloads a theme that was modified on disk.
(themeRef string)
| 705 | |
| 706 | // handleThemeFileChanged hot-reloads a theme that was modified on disk. |
| 707 | func (m *appModel) handleThemeFileChanged(themeRef string) (tea.Model, tea.Cmd) { |
| 708 | theme, err := styles.LoadTheme(themeRef) |
| 709 | if err != nil { |
| 710 | return m, notification.ErrorCmd(fmt.Sprintf("Failed to hot-reload theme: %v", err)) |
| 711 | } |
| 712 | styles.ApplyTheme(theme) |
| 713 | return m, tea.Batch( |
| 714 | notification.SuccessCmd("Theme hot-reloaded"), |
| 715 | core.CmdHandler(messages.ThemeChangedMsg{}), |
| 716 | ) |
| 717 | } |
| 718 | |
| 719 | // --- Miscellaneous --- |
| 720 |
no test coverage detected