diff --git a/internal/config/config.go b/internal/config/config.go index 2feb97d..1832429 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -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 @@ -37,7 +38,8 @@ func defaultConfig() *Config { ".venv", "vendor", }, - Editor: "code", + Editor: "code", + PageSize: 15, } } @@ -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 } diff --git a/internal/tui/model.go b/internal/tui/model.go index 2bb0dd1..49210cc 100644 --- a/internal/tui/model.go +++ b/internal/tui/model.go @@ -147,7 +147,7 @@ func NewModel(cfg *config.Config) Model { sortMode: SortByDirty, filterMode: FilterAll, currentPage: 0, - pageSize: 15, + pageSize: cfg.PageSize, } }