diff options
author | Sean <seand52@gmail.com> | 2023-01-21 11:38:14 +0000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-04-30 13:19:53 +1000 |
commit | 9d68b287db57b49eddf4b2b81ca1acd2e16aa5aa (patch) | |
tree | d286af9a7cfa27348fb5034ee01a1e16a699057b /pkg/gui/controllers/helpers/helpers.go | |
parent | a5c72d056ddbd639db3597ffb19a60e0cbae1826 (diff) |
Split commit message panel into commit summary and commit description panel
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting.
By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel,
and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message
from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel
and then 'enter' to submit the message.
We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept,
so we just push both contexts one after the other, and likewise remove both contexts when we escape.
Diffstat (limited to 'pkg/gui/controllers/helpers/helpers.go')
-rw-r--r-- | pkg/gui/controllers/helpers/helpers.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/gui/controllers/helpers/helpers.go b/pkg/gui/controllers/helpers/helpers.go index 7e54597e5..faf342f0a 100644 --- a/pkg/gui/controllers/helpers/helpers.go +++ b/pkg/gui/controllers/helpers/helpers.go @@ -32,6 +32,7 @@ type Helpers struct { GPG *GpgHelper Upstream *UpstreamHelper AmendHelper *AmendHelper + Commits *CommitsHelper Snake *SnakeHelper // lives in context package because our contexts need it to render to main Diff *DiffHelper @@ -64,6 +65,7 @@ func NewStubHelpers() *Helpers { GPG: &GpgHelper{}, Upstream: &UpstreamHelper{}, AmendHelper: &AmendHelper{}, + Commits: &CommitsHelper{}, Snake: &SnakeHelper{}, Diff: &DiffHelper{}, Repos: &ReposHelper{}, |