feat: e on the status pane edits the config, as in lazygit
Instead of a global E: e on the status pane opens the config, shown in its footer as "e edit config". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
7 files changed
+26
-16
No files matched your search
@@ -350,8 +350,9 @@ func TestEditConfig(t *testing.T) {
|
||||
d := newDriverOpts(t, Options{ConfigFiles: []string{path}, OpenURL: func(u string) error { opened = append(opened, u); return nil }})
|
||||
d.m.getenv = func(string) string { return "" }
|
||||
|
||||
// No editor: the system's default app, on a config made for it.
|
||||
d.keys("E")
|
||||
// e on the status pane. No editor: the system's default app, on a
|
||||
// config made for it.
|
||||
d.keys("0", "e")
|
||||
if !slices.Equal(opened, []string{path}) {
|
||||
t.Errorf("opened %q", opened)
|
||||
}
|
||||
@@ -382,3 +383,12 @@ func TestEditConfig(t *testing.T) {
|
||||
t.Errorf("flash %q", d.m.flash.text)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStatusFooterEditsConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriver(t)
|
||||
d.keys("0")
|
||||
if !strings.Contains(d.screen(), "e edit config") {
|
||||
t.Errorf("no edit config in the footer:\n%s", d.screen())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user