mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-10-18 16:38:56 +03:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1d489252fe | ||
|
06358c35f9 | ||
|
005233b529 | ||
|
18d25458da | ||
|
db97ac515d | ||
|
200f95759b |
12
.github/workflows/soft-serve.yml
vendored
Normal file
12
.github/workflows/soft-serve.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
name: soft-serve
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
soft-serve:
|
||||||
|
uses: charmbracelet/meta/.github/workflows/soft-serve.yml@main
|
||||||
|
secrets:
|
||||||
|
ssh-key: "${{ secrets.CHARM_SOFT_SERVE_KEY }}"
|
@@ -149,8 +149,8 @@ var DefaultKeyMap = KeyMap{
|
|||||||
key.WithHelp("↑/k", "move up"), // corresponding help text
|
key.WithHelp("↑/k", "move up"), // corresponding help text
|
||||||
),
|
),
|
||||||
Down: key.NewBinding(
|
Down: key.NewBinding(
|
||||||
WithKeys("j", "down"),
|
key.WithKeys("j", "down"),
|
||||||
WithHelp("↓/j", "move down"),
|
key.WithHelp("↓/j", "move down"),
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,6 +178,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
* [mritd/bubbles](https://github.com/mritd/bubbles): Some general-purpose
|
* [mritd/bubbles](https://github.com/mritd/bubbles): Some general-purpose
|
||||||
bubbles. Inputs with validation, menu selection, a modified progressbar, and
|
bubbles. Inputs with validation, menu selection, a modified progressbar, and
|
||||||
so on.
|
so on.
|
||||||
|
* [bubblelister](https://github.com/treilik/bubblelister): An alternate list
|
||||||
|
that is scrollable without pagination and has the ability to contain other
|
||||||
|
bubbles as list items.
|
||||||
|
* [bubbleboxer](https://github.com/treilik/bubbleboxer): Layout multiple bubbles
|
||||||
|
side-by-side in a layout-tree.
|
||||||
|
|
||||||
If you’ve built a Bubble you think should be listed here,
|
If you’ve built a Bubble you think should be listed here,
|
||||||
[let us know](mailto:vt100@charm.sh).
|
[let us know](mailto:vt100@charm.sh).
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
// key.WithHelp("↑/k", "move up"), // corresponding help text
|
// key.WithHelp("↑/k", "move up"), // corresponding help text
|
||||||
// ),
|
// ),
|
||||||
// Down: key.NewBinding(
|
// Down: key.NewBinding(
|
||||||
// WithKeys("j", "down"),
|
// key.WithKeys("j", "down"),
|
||||||
// WithHelp("↓/j", "move down"),
|
// key.WithHelp("↓/j", "move down"),
|
||||||
// ),
|
// ),
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
10
list/list.go
10
list/list.go
@@ -107,6 +107,8 @@ type Model struct {
|
|||||||
// Key mappings for navigating the list.
|
// Key mappings for navigating the list.
|
||||||
KeyMap KeyMap
|
KeyMap KeyMap
|
||||||
|
|
||||||
|
disableQuitKeybindings bool
|
||||||
|
|
||||||
// Additional key mappings for the short and full help views. This allows
|
// Additional key mappings for the short and full help views. This allows
|
||||||
// you to add additional key mappings to the help menu without
|
// you to add additional key mappings to the help menu without
|
||||||
// re-implementing the help component. Of course, you can also disable the
|
// re-implementing the help component. Of course, you can also disable the
|
||||||
@@ -324,7 +326,8 @@ func (m *Model) SetItem(index int, item Item) tea.Cmd {
|
|||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert an item at the given index. This returns a command.
|
// Insert an item at the given index. If index is out of the upper bound, the
|
||||||
|
// item will be appended. This returns a command.
|
||||||
func (m *Model) InsertItem(index int, item Item) tea.Cmd {
|
func (m *Model) InsertItem(index int, item Item) tea.Cmd {
|
||||||
var cmd tea.Cmd
|
var cmd tea.Cmd
|
||||||
m.items = insertItemIntoSlice(m.items, item, index)
|
m.items = insertItemIntoSlice(m.items, item, index)
|
||||||
@@ -520,6 +523,7 @@ func (m *Model) StopSpinner() {
|
|||||||
// Helper for disabling the keybindings used for quitting, incase you want to
|
// Helper for disabling the keybindings used for quitting, incase you want to
|
||||||
// handle this elsewhere in your application.
|
// handle this elsewhere in your application.
|
||||||
func (m *Model) DisableQuitKeybindings() {
|
func (m *Model) DisableQuitKeybindings() {
|
||||||
|
m.disableQuitKeybindings = true
|
||||||
m.KeyMap.Quit.SetEnabled(false)
|
m.KeyMap.Quit.SetEnabled(false)
|
||||||
m.KeyMap.ForceQuit.SetEnabled(false)
|
m.KeyMap.ForceQuit.SetEnabled(false)
|
||||||
}
|
}
|
||||||
@@ -602,7 +606,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 +626,7 @@ 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)
|
m.KeyMap.Quit.SetEnabled(!m.disableQuitKeybindings)
|
||||||
|
|
||||||
if m.Help.ShowAll {
|
if m.Help.ShowAll {
|
||||||
m.KeyMap.ShowFullHelp.SetEnabled(true)
|
m.KeyMap.ShowFullHelp.SetEnabled(true)
|
||||||
|
Reference in New Issue
Block a user