Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi_select: pressing ctrl_a or ctrl_r on filtered results, raises an exception #181

Open
bill-kolokithas opened this issue Mar 10, 2022 · 0 comments

Comments

@bill-kolokithas
Copy link

Describe the problem

Pressing ctrl+a or ctrl+r on filtered results, raises an exception.

Steps to reproduce the problem

Create a multi_select with the filter: true option enabled

TTY::Prompt.new.multi_select('multi', ['a', 'b'], filter: true)
multi
  a
   b

Type something to filter the results

TTY::Prompt.new.multi_select('multi', ['a', 'b'], filter: true)
multi (Filter: "a")
  a

press ctrl+a

Traceback (most recent call last):
       16: from /home/billk/code/tty-prompt/lib/tty/prompt.rb:249:in `invoke_select'
       15: from /home/billk/code/tty-prompt/lib/tty/prompt/list.rb:244:in `call'
       14: from /home/billk/.gem/ruby/2.5.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:118:in `subscribe'
       13: from /home/billk/code/tty-prompt/lib/tty/prompt/list.rb:245:in `block in call'
       12: from /home/billk/code/tty-prompt/lib/tty/prompt/list.rb:454:in `render'
       11: from /home/billk/.gem/ruby/2.5.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:190:in `read_keypress'
       10: from /home/billk/.gem/ruby/2.5.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:476:in `trigger_key_event'
        9: from /home/billk/.gem/ruby/2.5.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:422:in `trigger'
        8: from /home/billk/.gem/ruby/2.5.0/gems/wisper-2.0.1/lib/wisper/publisher.rb:42:in `broadcast'
        7: from /usr/lib/ruby/2.5.0/set.rb:338:in `each'
        6: from /usr/lib/ruby/2.5.0/set.rb:338:in `each_key'
        5: from /home/billk/.gem/ruby/2.5.0/gems/wisper-2.0.1/lib/wisper/publisher.rb:43:in `block in broadcast'
        4: from /home/billk/.gem/ruby/2.5.0/gems/wisper-2.0.1/lib/wisper/registration/object.rb:18:in `broadcast'
        3: from /home/billk/.gem/ruby/2.5.0/gems/wisper-2.0.1/lib/wisper/broadcasters/send_broadcaster.rb:5:in `broadcast'
        2: from /home/billk/.gem/ruby/2.5.0/gems/wisper-2.0.1/lib/wisper/broadcasters/send_broadcaster.rb:5:in `public_send'
        1: from /home/billk/code/tty-prompt/lib/tty/prompt/multi_list.rb:74:in `keyctrl_a'
NoMethodError (undefined method `enabled' for #<Array:0x0000562dd3058910>)
  • OS version: Debian 10 (buster)
  • Ruby version: ruby 2.5.5p157
  • TTY::Prompt version: v0.23.1

Additional info

There is no tagged version with the above feature working.
The ctrl+a feature was added in this commit: 17bd772731073a6537a
This commit broke the feature a7713c6d912e65d202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant