mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 22:33:07 +02:00
Add a GetShortDescription() method to Binding
This commit is contained in:
@ -50,14 +50,9 @@ func (self *OptionsMapMgr) renderContextOptionsMap() {
|
|||||||
displayStyle = *binding.DisplayStyle
|
displayStyle = *binding.DisplayStyle
|
||||||
}
|
}
|
||||||
|
|
||||||
description := binding.Description
|
|
||||||
if binding.ShortDescription != "" {
|
|
||||||
description = binding.ShortDescription
|
|
||||||
}
|
|
||||||
|
|
||||||
return bindingInfo{
|
return bindingInfo{
|
||||||
key: keybindings.LabelFromKey(binding.Key),
|
key: keybindings.LabelFromKey(binding.Key),
|
||||||
description: description,
|
description: binding.GetShortDescription(),
|
||||||
style: displayStyle,
|
style: displayStyle,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -47,6 +47,13 @@ func (b *Binding) IsDisabled() bool {
|
|||||||
return b.GetDisabledReason != nil && b.GetDisabledReason() != nil
|
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
|
// A guard is a decorator which checks something before executing a handler
|
||||||
// and potentially early-exits if some precondition hasn't been met.
|
// and potentially early-exits if some precondition hasn't been met.
|
||||||
type Guard func(func() error) func() error
|
type Guard func(func() error) func() error
|
||||||
|
Reference in New Issue
Block a user