-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Use TranslationSet.Close
for the Close
keybind label in ConfirmationController
#4808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -161,7 +161,6 @@ type TranslationSet struct { | |||
NoBranchesThisRepo string | |||
CommitWithoutMessageErr string | |||
Close string | |||
CloseCancel string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted this line because this field is no longer referenced.
I'm not sure this is the best fix; ideally, we shouldn't see Esc twice in the bottom line. The same happens for menus, you see We should find a way to make sure every keybinding only appears once; I'm not sure yet what the best way is, I'll have to spend some time with the code to make up my mind about that. I also see that Since this is only a minor cosmetic problem, it might take me a while to get around to it. |
This problem might be fixed by an implementation like this (NOTE: This is a kind of PoC. When this code is needed, I will refine it). diff --git i/pkg/gui/options_map.go w/pkg/gui/options_map.go
index bacc3b106..b284a9c89 100644
--- i/pkg/gui/options_map.go
+++ w/pkg/gui/options_map.go
@@ -39,6 +39,20 @@ func (self *OptionsMapMgr) renderContextOptionsMap() {
globalBindings := self.c.Contexts().Global.GetKeybindings(self.c.KeybindingsOpts())
allBindings := append(currentContextBindings, globalBindings...)
+ result := make([]*types.Binding, 0, len(allBindings))
+
+OUTER:
+ for _, binding := range allBindings {
+ for i, existingBinding := range result {
+ if existingBinding.Key == binding.Key {
+ // If the binding already exists, we just update its description
+ result[i].Description = fmt.Sprintf("%s/%s", existingBinding.Description, binding.Description)
+ continue OUTER
+ }
+ }
+ result = append(result, binding)
+ }
+ allBindings = result
bindingsToDisplay := lo.Filter(allBindings, func(binding *types.Binding, _ int) bool {
return binding.DisplayOnScreen && !binding.IsDisabled() But if we could delete all the unnecessary keybindings like So maybe it is more important to solve the problem below first.
What do you think? |
@stefanhaller |
PR Description
WHAT
I changed the wording of
ConfirmationController
like below.WHY
Now, the keybindings are like below when the confirmation window is shown.
I felt that
Close/Cancel
andCancel
are duplicated.And it looks like
Cancel
is added to all controllers. So I changed the wording likeMenuController
is doing, instead of deletingClose
inConfirmationController
.Please check if the PR fulfills these requirements
go generate ./...
)If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)Docs have been updated if necessary