Skip to content

Commit a493743

Browse files
authored
fix: remove reload config (#11)
1 parent a0fc0bf commit a493743

4 files changed

Lines changed: 3 additions & 38 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ To enable hints in Chrome:
370370
]
371371
```
372372

373-
2. Reload config: `Cmd+Shift+R`
374373

375374
## Development
376375

cmd/govim/main.go

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,7 @@ func (a *App) registerHotkeys() error {
232232

233233
// Note: Escape key for exiting modes is hardcoded in handleKeyPress, not registered as global hotkey
234234

235-
// Reload config hotkey
236-
if key := strings.TrimSpace(a.config.Hotkeys.ReloadConfig); key != "" {
237-
a.logger.Info("Registering reload config hotkey", zap.String("key", key))
238-
if _, err := a.hotkeyManager.Register(key, a.reloadConfig); err != nil {
239-
a.logger.Warn("Failed to register reload config hotkey", zap.Error(err))
240-
}
241-
}
235+
// ...existing code...
242236

243237
return nil
244238
}
@@ -871,28 +865,7 @@ func (a *App) exitMode() {
871865
a.currentMode = ModeIdle
872866
}
873867

874-
// reloadConfig reloads the configuration
875-
func (a *App) reloadConfig() {
876-
a.logger.Info("Reloading configuration")
877-
878-
newConfig, err := config.Load("")
879-
if err != nil {
880-
a.logger.Error("Failed to reload configuration", zap.Error(err))
881-
return
882-
}
883-
884-
a.config = newConfig
885-
a.logger.Info("Applying clickable roles",
886-
zap.Int("count", len(newConfig.Accessibility.ClickableRoles)),
887-
zap.Strings("roles", newConfig.Accessibility.ClickableRoles))
888-
accessibility.SetClickableRoles(newConfig.Accessibility.ClickableRoles)
889-
890-
a.logger.Info("Applying scrollable roles",
891-
zap.Int("count", len(newConfig.Accessibility.ScrollableRoles)),
892-
zap.Strings("roles", newConfig.Accessibility.ScrollableRoles))
893-
accessibility.SetScrollableRoles(newConfig.Accessibility.ScrollableRoles)
894-
a.logger.Info("Configuration reloaded successfully")
895-
}
868+
// ...existing code...
896869

897870
// getModeString returns the current mode as a string
898871
func (a *App) getModeString() string {

configs/default-config.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ activate_hint_mode_with_actions = "Cmd+Shift+A"
8080
# Activate scroll mode for vim-style scrolling
8181
activate_scroll_mode = "Cmd+Shift+J"
8282

83-
# Reload configuration
84-
reload_config = "Cmd+Shift+R"
8583

8684
# Note: Escape key is hardcoded to exit any active mode
8785

@@ -155,7 +153,7 @@ scroll_to_edge_delta = 5000
155153

156154
[performance]
157155
# Maximum number of hints to display
158-
max_hints_displayed = 200
156+
max_hints_displayed = 500
159157

160158
# Debounce time for UI updates (milliseconds)
161159
debounce_ms = 50

internal/config/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ type HotkeysConfig struct {
4444
ActivateHintMode string `toml:"activate_hint_mode"`
4545
ActivateHintModeWithActions string `toml:"activate_hint_mode_with_actions"`
4646
ActivateScrollMode string `toml:"activate_scroll_mode"`
47-
ReloadConfig string `toml:"reload_config"`
4847
}
4948

5049
type ScrollConfig struct {
@@ -126,7 +125,6 @@ func DefaultConfig() *Config {
126125
ActivateHintMode: "",
127126
ActivateHintModeWithActions: "",
128127
ActivateScrollMode: "",
129-
ReloadConfig: "",
130128
},
131129
Scroll: ScrollConfig{
132130
ScrollSpeed: 50,
@@ -276,9 +274,6 @@ func (c *Config) Validate() error {
276274
if err := validateHotkey(c.Hotkeys.ActivateScrollMode, "hotkeys.activate_scroll_mode"); err != nil {
277275
return err
278276
}
279-
if err := validateHotkey(c.Hotkeys.ReloadConfig, "hotkeys.reload_config"); err != nil {
280-
return err
281-
}
282277

283278
// Validate colors
284279
if err := validateColor(c.Hints.BackgroundColor, "hints.background_color"); err != nil {

0 commit comments

Comments
 (0)