Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (

// Config holds the application configuration
type Config struct {
Roots []string `yaml:"roots"`
Ignore []string `yaml:"ignore"`
Editor string `yaml:"editor"`
Roots []string `yaml:"roots"`
Ignore []string `yaml:"ignore"`
Editor string `yaml:"editor"`
PageSize int `yaml:"pageSize,omitempty"`
}

// defaultConfig returns sensible defaults
Expand All @@ -37,7 +38,8 @@ func defaultConfig() *Config {
".venv",
"vendor",
},
Editor: "code",
Editor: "code",
PageSize: 15,
}
}

Expand All @@ -63,6 +65,11 @@ func Load(path string) (*Config, error) {
cfg.Roots[i] = expandPath(root)
}

// Ensure pageSize has a sensible value
if cfg.PageSize <= 0 {
cfg.PageSize = 15
}

return cfg, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/tui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func NewModel(cfg *config.Config) Model {
sortMode: SortByDirty,
filterMode: FilterAll,
currentPage: 0,
pageSize: 15,
pageSize: cfg.PageSize,
}
}

Expand Down