refactor: extract internal/config and eliminate global config var

Move Config struct to internal/config with exported fields. Replace
global var config with package-level cfg pointer. Add OpenLogFile to
config package. Add type alias Config = appconfig.Config in main
package for backward compatibility.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
JiXieShi
2026-05-23 21:45:08 +08:00
parent 2ce672cdde
commit 31dd9da490
15 changed files with 198 additions and 189 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
func handleLocalHotkey(m *uiModel, key string) bool {
if m.isLocalHotkey(key, "h") {
modifier := strings.ToUpper(normalizeHotkeyPrefix(m.app.cfg.hotkeyMod))
modifier := strings.ToUpper(normalizeHotkeyPrefix(m.app.cfg.HotkeyMod))
m.app.ShowModal("Shortcuts", modifier+"+C => local exit\nCtrl+C => remote interrupt\n"+modifier+"+F => forward panel\n"+modifier+"+P => plugin panel\n"+modifier+"+M => mode panel\nF1 => shortcut help")
return true
}
@@ -48,7 +48,7 @@ func (m *uiModel) isLocalHotkey(key, action string) bool {
}
}
mod := normalizeHotkeyPrefix(m.app.cfg.hotkeyMod)
mod := normalizeHotkeyPrefix(m.app.cfg.HotkeyMod)
if mod == "ctrl+shift" {
return hasCtrl && hasShift
}