mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-14 09:36:24 -04:00
Add a GetShortDescription() method to Binding
This commit is contained in:
parent
d0438b7d33
commit
9eb1e3a729
|
|
@ -50,14 +50,9 @@ func (self *OptionsMapMgr) renderContextOptionsMap() {
|
|||
displayStyle = *binding.DisplayStyle
|
||||
}
|
||||
|
||||
description := binding.Description
|
||||
if binding.ShortDescription != "" {
|
||||
description = binding.ShortDescription
|
||||
}
|
||||
|
||||
return bindingInfo{
|
||||
key: keybindings.LabelFromKey(binding.Key),
|
||||
description: description,
|
||||
description: binding.GetShortDescription(),
|
||||
style: displayStyle,
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -47,6 +47,13 @@ func (b *Binding) IsDisabled() bool {
|
|||
return b.GetDisabledReason != nil && b.GetDisabledReason() != nil
|
||||
}
|
||||
|
||||
func (b *Binding) GetShortDescription() string {
|
||||
if b.ShortDescription != "" {
|
||||
return b.ShortDescription
|
||||
}
|
||||
return b.Description
|
||||
}
|
||||
|
||||
// A guard is a decorator which checks something before executing a handler
|
||||
// and potentially early-exits if some precondition hasn't been met.
|
||||
type Guard func(func() error) func() error
|
||||
|
|
|
|||
Loading…
Reference in a new issue