mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-25 15:04:39 +03:00
fix(list): DisableQuitKeybinding is ignored after updating the list (#108)
This commit is contained in:
parent
db97ac515d
commit
18d25458da
@ -590,6 +590,7 @@ func (m Model) itemsAsFilterItems() filteredItems {
|
|||||||
|
|
||||||
// Set keybindings according to the filter state.
|
// Set keybindings according to the filter state.
|
||||||
func (m *Model) updateKeybindings() {
|
func (m *Model) updateKeybindings() {
|
||||||
|
quit := m.KeyMap.Quit.Enabled()
|
||||||
switch m.filterState {
|
switch m.filterState {
|
||||||
case Filtering:
|
case Filtering:
|
||||||
m.KeyMap.CursorUp.SetEnabled(false)
|
m.KeyMap.CursorUp.SetEnabled(false)
|
||||||
@ -602,7 +603,7 @@ func (m *Model) updateKeybindings() {
|
|||||||
m.KeyMap.ClearFilter.SetEnabled(false)
|
m.KeyMap.ClearFilter.SetEnabled(false)
|
||||||
m.KeyMap.CancelWhileFiltering.SetEnabled(true)
|
m.KeyMap.CancelWhileFiltering.SetEnabled(true)
|
||||||
m.KeyMap.AcceptWhileFiltering.SetEnabled(m.FilterInput.Value() != "")
|
m.KeyMap.AcceptWhileFiltering.SetEnabled(m.FilterInput.Value() != "")
|
||||||
m.KeyMap.Quit.SetEnabled(true)
|
m.KeyMap.Quit.SetEnabled(false)
|
||||||
m.KeyMap.ShowFullHelp.SetEnabled(false)
|
m.KeyMap.ShowFullHelp.SetEnabled(false)
|
||||||
m.KeyMap.CloseFullHelp.SetEnabled(false)
|
m.KeyMap.CloseFullHelp.SetEnabled(false)
|
||||||
|
|
||||||
@ -622,7 +623,6 @@ func (m *Model) updateKeybindings() {
|
|||||||
m.KeyMap.ClearFilter.SetEnabled(m.filterState == FilterApplied)
|
m.KeyMap.ClearFilter.SetEnabled(m.filterState == FilterApplied)
|
||||||
m.KeyMap.CancelWhileFiltering.SetEnabled(false)
|
m.KeyMap.CancelWhileFiltering.SetEnabled(false)
|
||||||
m.KeyMap.AcceptWhileFiltering.SetEnabled(false)
|
m.KeyMap.AcceptWhileFiltering.SetEnabled(false)
|
||||||
m.KeyMap.Quit.SetEnabled(true)
|
|
||||||
|
|
||||||
if m.Help.ShowAll {
|
if m.Help.ShowAll {
|
||||||
m.KeyMap.ShowFullHelp.SetEnabled(true)
|
m.KeyMap.ShowFullHelp.SetEnabled(true)
|
||||||
@ -633,6 +633,7 @@ func (m *Model) updateKeybindings() {
|
|||||||
m.KeyMap.CloseFullHelp.SetEnabled(minHelp)
|
m.KeyMap.CloseFullHelp.SetEnabled(minHelp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m.KeyMap.Quit.SetEnabled(quit)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update pagination according to the amount of items for the current state.
|
// Update pagination according to the amount of items for the current state.
|
||||||
|
Loading…
Reference in New Issue
Block a user