Skip to content

Commit e25b239

Browse files
committed
Update help text and streamline logging in LoadConfig function
1 parent 71d1f29 commit e25b239

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

cmd/ui/codeviewerview/codeviewerview.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func New(path string, windowSize tea.WindowSizeMsg, viewChanger view.ViewChanger
4040
info := styles.ViewPortInfoStyle.Render(fmt.Sprintf("%3.f%%", vp.ScrollPercent()*100))
4141
footer := lipgloss.JoinHorizontal(lipgloss.Center, line, info)
4242
footerHeight := lipgloss.Height(footer)
43-
help := styles.HelpStyle.Render("↑/k: up, ↓/j: down, u: ½ page up, d: ½ page down, backspace: back")
43+
help := styles.HelpStyle.Render("↑/k: up, ↓/j: down, u: ½ page up, d: ½ page down, Ctrl+←: back")
4444
helpHeight := lipgloss.Height(help)
4545
verticalMarginHeight := headerHeight + footerHeight + helpHeight
4646
vp.YPosition = headerHeight

cmd/utils/config.go

-11
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ var ConfigStoreData []ConfigStore
4949
var config *Config
5050

5151
func LoadConfig() (*Config, error) {
52-
log.Printf("Loading config file")
5352
if config != nil {
5453
return config, nil
5554
}
@@ -65,24 +64,20 @@ func LoadConfig() (*Config, error) {
6564
viper.AddConfigPath(UserConfigDir)
6665

6766
exe, exeerr := os.Executable()
68-
log.Printf("Executable: %s", exe)
6967
var exeDir string
7068
if exeerr != nil {
7169
log.Printf("Error getting executable: %v", exeerr)
7270
return nil, fmt.Errorf("error getting executable: %w", exeerr)
7371
}
7472
if filepath.Ext(exe) == ".lnk" {
75-
log.Printf("Shortcut detected: %s", exe)
7673
exePath, _, direrr := shortcut.Read(exe)
7774
if direrr != nil {
7875
log.Printf("Error reading shortcut: %v", direrr)
7976
return nil, fmt.Errorf("error reading shortcut: %w", direrr)
8077
}
8178
if exePath != "" {
82-
log.Printf("Shortcut path: %s", exePath)
8379
exeDir = filepath.Dir(exePath)
8480
} else {
85-
log.Printf("Shortcut path is empty: %s", exePath)
8681
exeDir = ""
8782
}
8883
} else {
@@ -97,18 +92,13 @@ func LoadConfig() (*Config, error) {
9792

9893
// Log the configuration files found
9994
for _, path := range configPaths {
100-
log.Printf("Checking config directory: %s", path)
10195
if path == "." {
102-
log.Println("Getting current working directory")
10396
path, _ = os.Getwd()
10497
}
10598
configFile := filepath.Join(path, "config.yaml")
106-
log.Printf("Checking config file: %s", configFile)
10799
if _, err := os.Stat(configFile); err == nil {
108-
log.Printf("Config file exists: %s", configFile)
109100
ConfigStoreData = append(ConfigStoreData, ConfigStore{Path: path, Exists: true})
110101
} else {
111-
log.Printf("Config file doesn't exist: %s", configFile)
112102
ConfigStoreData = append(ConfigStoreData, ConfigStore{Path: path, Exists: false})
113103
}
114104
}
@@ -129,7 +119,6 @@ func LoadConfig() (*Config, error) {
129119
log.Printf("Unable to decode into struct: %v", err)
130120
return nil, fmt.Errorf("unable to decode into struct: %w", err)
131121
}
132-
log.Printf("Config file loaded: %+v", config)
133122
return config, nil
134123
}
135124

0 commit comments

Comments
 (0)