fix(chat): hide redundant help actions
This commit is contained in:
parent
235cecb3eb
commit
8d8e855777
2 changed files with 23 additions and 12 deletions
|
|
@ -839,7 +839,7 @@ func (c *composer) ShortHelp() []keybind.Keybind {
|
||||||
if c.chat.GetVisible(mentionsListLayerName) {
|
if c.chat.GetVisible(mentionsListLayerName) {
|
||||||
cfg := c.cfg.Keybinds.MentionsList
|
cfg := c.cfg.Keybinds.MentionsList
|
||||||
ccfg := c.cfg.Keybinds.Composer
|
ccfg := c.cfg.Keybinds.Composer
|
||||||
short := []keybind.Keybind{cfg.SelectUp.Keybind, cfg.SelectDown.Keybind, ccfg.Cancel.Keybind}
|
short := []keybind.Keybind{cfg.SelectUp.Keybind, cfg.SelectDown.Keybind, ccfg.TabComplete.Keybind, ccfg.Cancel.Keybind}
|
||||||
if c.canAttachFiles() {
|
if c.canAttachFiles() {
|
||||||
short = append(short, ccfg.OpenFilePicker.Keybind)
|
short = append(short, ccfg.OpenFilePicker.Keybind)
|
||||||
}
|
}
|
||||||
|
|
@ -872,7 +872,7 @@ func (c *composer) FullHelp() [][]keybind.Keybind {
|
||||||
}
|
}
|
||||||
|
|
||||||
return [][]keybind.Keybind{
|
return [][]keybind.Keybind{
|
||||||
{cfg.Send.Keybind, cfg.Newline.Keybind, cfg.Cancel.Keybind, cfg.TabComplete.Keybind, cfg.Undo.Keybind},
|
{cfg.Send.Keybind, cfg.Newline.Keybind, cfg.Cancel.Keybind, cfg.Undo.Keybind},
|
||||||
openEditor,
|
openEditor,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,24 +44,35 @@ func (m *Model) activeKeyMap() help.KeyMap {
|
||||||
|
|
||||||
func (m *Model) baseShortHelp() []keybind.Keybind {
|
func (m *Model) baseShortHelp() []keybind.Keybind {
|
||||||
cfg := m.cfg.Keybinds
|
cfg := m.cfg.Keybinds
|
||||||
short := []keybind.Keybind{cfg.FocusGuildsTree.Keybind, cfg.FocusMessagesList.Keybind}
|
short := m.focusHelp()
|
||||||
if !m.composer.Disabled() {
|
|
||||||
short = append(short, cfg.FocusComposer.Keybind)
|
|
||||||
}
|
|
||||||
short = append(short, cfg.ToggleGuildsTree.Keybind, cfg.ToggleChannelsPicker.Keybind)
|
short = append(short, cfg.ToggleGuildsTree.Keybind, cfg.ToggleChannelsPicker.Keybind)
|
||||||
return short
|
return short
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Model) baseFullHelp() [][]keybind.Keybind {
|
func (m *Model) baseFullHelp() [][]keybind.Keybind {
|
||||||
cfg := m.cfg.Keybinds
|
cfg := m.cfg.Keybinds
|
||||||
focus := []keybind.Keybind{cfg.FocusGuildsTree.Keybind, cfg.FocusMessagesList.Keybind}
|
|
||||||
if !m.composer.Disabled() {
|
|
||||||
focus = append(focus, cfg.FocusComposer.Keybind)
|
|
||||||
}
|
|
||||||
return [][]keybind.Keybind{
|
return [][]keybind.Keybind{
|
||||||
focus,
|
m.focusHelp(),
|
||||||
{cfg.FocusPrevious.Keybind, cfg.FocusNext.Keybind},
|
{cfg.FocusPrevious.Keybind, cfg.FocusNext.Keybind},
|
||||||
{cfg.ToggleGuildsTree.Keybind, cfg.ToggleChannelsPicker.Keybind},
|
{cfg.ToggleGuildsTree.Keybind, cfg.ToggleChannelsPicker.Keybind},
|
||||||
{cfg.Logout.Keybind},
|
{cfg.Logout.Keybind},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Model) focusHelp() []keybind.Keybind {
|
||||||
|
kbs := m.cfg.Keybinds
|
||||||
|
focused := m.app.Focused()
|
||||||
|
focusKbs := make([]keybind.Keybind, 0, 3)
|
||||||
|
|
||||||
|
if focused != m.guildsTree {
|
||||||
|
focusKbs = append(focusKbs, kbs.FocusGuildsTree.Keybind)
|
||||||
|
}
|
||||||
|
if focused != m.messagesList {
|
||||||
|
focusKbs = append(focusKbs, kbs.FocusMessagesList.Keybind)
|
||||||
|
}
|
||||||
|
if !m.composer.Disabled() && focused != m.composer {
|
||||||
|
focusKbs = append(focusKbs, kbs.FocusComposer.Keybind)
|
||||||
|
}
|
||||||
|
|
||||||
|
return focusKbs
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue