Skip to content

Commit

Permalink
Merge branch 'main' into refactor-and-factory-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson authored Jul 14, 2024
2 parents 64aeb36 + bf86f31 commit f303e6e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/bundle_update_interactive/cli/multi_select.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def initialize(title:, table:)
exit(130)
}
)
add_keybindings

@pastel = BundleUpdateInteractive.pastel
end

Expand All @@ -51,6 +53,13 @@ def prompt

attr_reader :pastel, :table, :tty_prompt, :title

def add_keybindings
tty_prompt.on(:keypress) do |event|
tty_prompt.trigger(:keyup) if %w[k p].include?(event.value)
tty_prompt.trigger(:keydown) if %w[j n].include?(event.value)
end
end

def help
[
pastel.dim("\nPress <space> to select, ↑/↓ move, <ctrl-a> all, <ctrl-r> reverse, <enter> to finish."),
Expand Down

0 comments on commit f303e6e

Please sign in to comment.