feat(config): default layout gaps to 0
- commit
- 493b4a9dbfda77ebc8de0389954d88dcb4912ce8
- author
- brice · · 2026-09-24 09:30 UTC
- parent
- 3ef2072
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
5 files · +8 -5
M README.md +1 -1
| @@ -16,7 +16,7 @@ Configuration lives at `$XDG_CONFIG_HOME/nefertty/config.toml` (or `~/.config/ne | |||
| 16 | 16 | [terminal] | |
| 17 | 17 | command = ["foot"] | |
| 18 | 18 | [layout] | |
| 19 | - | gaps = 8 | |
| 19 | + | gaps = 0 | |
| 20 | 20 | ``` | |
| 21 | 21 | ||
| 22 | 22 | See `examples/config.toml` for all defaults. Configuration reloads automatically when the file changes (including atomic replacements). Layout gaps, widths and presets, binds, background, and terminal command apply live; `keyboard.*` requires a restart for now. Invalid or removed files leave the current configuration in place. | |
| @@ -16,7 +16,7 @@ Configuration lives at `$XDG_CONFIG_HOME/nefertty/config.toml` (or `~/.config/ne | |||||
| 16 | [terminal] | 16 | [terminal] | ||
| 17 | command = ["foot"] | 17 | command = ["foot"] | ||
| 18 | [layout] | 18 | [layout] | ||
| 19 | - | gaps = 8 | 19 | + | gaps = 0 |
| 20 | ``` | 20 | ``` | ||
| 21 | 21 | ||||
| 22 | See `examples/config.toml` for all defaults. Configuration reloads automatically when the file changes (including atomic replacements). Layout gaps, widths and presets, binds, background, and terminal command apply live; `keyboard.*` requires a restart for now. Invalid or removed files leave the current configuration in place. | 22 | See `examples/config.toml` for all defaults. Configuration reloads automatically when the file changes (including atomic replacements). Layout gaps, widths and presets, binds, background, and terminal command apply live; `keyboard.*` requires a restart for now. Invalid or removed files leave the current configuration in place. | ||
M examples/config.toml +1 -1
| @@ -19,7 +19,7 @@ active = "#b4befe" | |||
| 19 | 19 | inactive = "" | |
| 20 | 20 | ||
| 21 | 21 | [layout] | |
| 22 | - | gaps = 8 | |
| 22 | + | gaps = 0 | |
| 23 | 23 | default_column_width = "1/2" | |
| 24 | 24 | presets = ["1/3", "1/2", "2/3", "1"] | |
| 25 | 25 | ||
| @@ -19,7 +19,7 @@ active = "#b4befe" | |||||
| 19 | inactive = "" | 19 | inactive = "" | ||
| 20 | 20 | ||||
| 21 | [layout] | 21 | [layout] | ||
| 22 | - | gaps = 8 | 22 | + | gaps = 0 |
| 23 | default_column_width = "1/2" | 23 | default_column_width = "1/2" | ||
| 24 | presets = ["1/3", "1/2", "2/3", "1"] | 24 | presets = ["1/3", "1/2", "2/3", "1"] | ||
| 25 | 25 | ||||
M internal/adapters/config/config.go +1 -1
| @@ -41,7 +41,7 @@ func Defaults() ports.Config { | |||
| 41 | 41 | c.Border.Width = 2 | |
| 42 | 42 | c.Border.Active = "#b4befe" | |
| 43 | 43 | c.Border.Inactive = "" | |
| 44 | - | c.Layout.Gaps = 8 | |
| 44 | + | c.Layout.Gaps = 0 | |
| 45 | 45 | c.Layout.DefaultColumnWidth = "1/2" | |
| 46 | 46 | c.Layout.Presets = []string{"1/3", "1/2", "2/3", "1"} | |
| 47 | 47 | c.Binds = make(map[string]string, len(defaultBinds)) | |
| @@ -41,7 +41,7 @@ func Defaults() ports.Config { | |||||
| 41 | c.Border.Width = 2 | 41 | c.Border.Width = 2 | ||
| 42 | c.Border.Active = "#b4befe" | 42 | c.Border.Active = "#b4befe" | ||
| 43 | c.Border.Inactive = "" | 43 | c.Border.Inactive = "" | ||
| 44 | - | c.Layout.Gaps = 8 | 44 | + | c.Layout.Gaps = 0 |
| 45 | c.Layout.DefaultColumnWidth = "1/2" | 45 | c.Layout.DefaultColumnWidth = "1/2" | ||
| 46 | c.Layout.Presets = []string{"1/3", "1/2", "2/3", "1"} | 46 | c.Layout.Presets = []string{"1/3", "1/2", "2/3", "1"} | ||
| 47 | c.Binds = make(map[string]string, len(defaultBinds)) | 47 | c.Binds = make(map[string]string, len(defaultBinds)) | ||
M internal/app/app_test.go +3 -2
| @@ -140,8 +140,9 @@ func TestHeadlessSpawnClose(t *testing.T) { | |||
| 140 | 140 | select { | |
| 141 | 141 | case s := <-scenes: | |
| 142 | 142 | if len(s.Windows) == count { | |
| 143 | - | if count == 1 && s.Windows[0].Rect.W != 948 { | |
| 144 | - | t.Errorf("width = %d, want 948", s.Windows[0].Rect.W) | |
| 143 | + | // Half of 1920 with the default zero gaps. | |
| 144 | + | if count == 1 && s.Windows[0].Rect.W != 960 { | |
| 145 | + | t.Errorf("width = %d, want 960", s.Windows[0].Rect.W) | |
| 145 | 146 | } | |
| 146 | 147 | return | |
| 147 | 148 | } | |
| @@ -140,8 +140,9 @@ func TestHeadlessSpawnClose(t *testing.T) { | |||||
| 140 | select { | 140 | select { | ||
| 141 | case s := <-scenes: | 141 | case s := <-scenes: | ||
| 142 | if len(s.Windows) == count { | 142 | if len(s.Windows) == count { | ||
| 143 | - | if count == 1 && s.Windows[0].Rect.W != 948 { | 143 | + | // Half of 1920 with the default zero gaps. |
| 144 | - | t.Errorf("width = %d, want 948", s.Windows[0].Rect.W) | 144 | + | if count == 1 && s.Windows[0].Rect.W != 960 { |
| 145 | + | t.Errorf("width = %d, want 960", s.Windows[0].Rect.W) | |||
| 145 | } | 146 | } | ||
| 146 | return | 147 | return | ||
| 147 | } | 148 | } | ||
M internal/core/core_test.go +2 -0
| @@ -25,6 +25,7 @@ func TestOwner(t *testing.T) { | |||
| 25 | 25 | cfg := config.Defaults() | |
| 26 | 26 | cfg.Keyboard.CmdKey = "alt" | |
| 27 | 27 | cfg.Border.Width = 0 | |
| 28 | + | cfg.Layout.Gaps = 8 | |
| 28 | 29 | client := make(chan ports.ClientEvent, 128) | |
| 29 | 30 | input := make(chan ports.InputEvent, 32) | |
| 30 | 31 | output := make(chan ports.OutputEvent, 8) | |
| @@ -197,6 +198,7 @@ func TestBoundReleaseSwallowed(t *testing.T) { | |||
| 197 | 198 | func TestPointerFocusAndGrab(t *testing.T) { | |
| 198 | 199 | cfg := config.Defaults() | |
| 199 | 200 | cfg.Border.Width = 0 | |
| 201 | + | cfg.Layout.Gaps = 8 | |
| 200 | 202 | client := make(chan ports.ClientEvent, 8) | |
| 201 | 203 | input := make(chan ports.InputEvent, 8) | |
| 202 | 204 | output := make(chan ports.OutputEvent, 8) | |
| @@ -25,6 +25,7 @@ func TestOwner(t *testing.T) { | |||||
| 25 | cfg := config.Defaults() | 25 | cfg := config.Defaults() | ||
| 26 | cfg.Keyboard.CmdKey = "alt" | 26 | cfg.Keyboard.CmdKey = "alt" | ||
| 27 | cfg.Border.Width = 0 | 27 | cfg.Border.Width = 0 | ||
| 28 | + | cfg.Layout.Gaps = 8 | |||
| 28 | client := make(chan ports.ClientEvent, 128) | 29 | client := make(chan ports.ClientEvent, 128) | ||
| 29 | input := make(chan ports.InputEvent, 32) | 30 | input := make(chan ports.InputEvent, 32) | ||
| 30 | output := make(chan ports.OutputEvent, 8) | 31 | output := make(chan ports.OutputEvent, 8) | ||
| @@ -197,6 +198,7 @@ func TestBoundReleaseSwallowed(t *testing.T) { | |||||
| 197 | func TestPointerFocusAndGrab(t *testing.T) { | 198 | func TestPointerFocusAndGrab(t *testing.T) { | ||
| 198 | cfg := config.Defaults() | 199 | cfg := config.Defaults() | ||
| 199 | cfg.Border.Width = 0 | 200 | cfg.Border.Width = 0 | ||
| 201 | + | cfg.Layout.Gaps = 8 | |||
| 200 | client := make(chan ports.ClientEvent, 8) | 202 | client := make(chan ports.ClientEvent, 8) | ||
| 201 | input := make(chan ports.InputEvent, 8) | 203 | input := make(chan ports.InputEvent, 8) | ||
| 202 | output := make(chan ports.OutputEvent, 8) | 204 | output := make(chan ports.OutputEvent, 8) | ||