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

Alt+. crashes in _extract_last_quote when last line is empty #128

Open
cben opened this issue Jul 20, 2016 · 0 comments
Open

Alt+. crashes in _extract_last_quote when last line is empty #128

cben opened this issue Jul 20, 2016 · 0 comments
Labels
good first issue (probably!) Some of these issues have hidden tentacles... good first issue

Comments

@cben
Copy link

cben commented Jul 20, 2016

Alt+. inserts the last word from previous line.
Simply pressing it after an empty line does not trigger this because empty lines are not added to history (at least in irb). But you can edit previous lines and then go back to editing current line:

> rm ~/.irb_history
> irb
irb(main):001:0> # Now press Up, Ctrl+U (making last history line empty), Down (to edit current line again), Alt+.
irb(main):002:0* /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:7560:in `_extract_last_quote': empty char-class: /((?:\\.|[^])+?) *$/ (RegexpError)
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:7553:in `history_arg_extract'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:7465:in `rl_yank_nth_arg_internal'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:7525:in `rl_yank_last_arg'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:4329:in `_rl_dispatch_subseq'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:4338:in `_rl_dispatch_subseq'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:4318:in `_rl_dispatch'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:4734:in `readline_internal_charloop'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:4808:in `readline_internal'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:4830:in `readline'
    from /usr/local/lib/ruby/gems/2.2.0/gems/rb-readline-0.5.3/lib/readline.rb:45:in `readline'
    from /usr/local/lib/ruby/2.2.0/irb/input-method.rb:150:in `gets'
    from /usr/local/lib/ruby/2.2.0/irb.rb:469:in `block (2 levels) in eval_input'
    from /usr/local/lib/ruby/2.2.0/irb.rb:623:in `signal_status'
    from /usr/local/lib/ruby/2.2.0/irb.rb:468:in `block in eval_input'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:188:in `call'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:188:in `buf_input'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:103:in `getc'
    from /usr/local/lib/ruby/2.2.0/irb/slex.rb:205:in `match_io'
    from /usr/local/lib/ruby/2.2.0/irb/slex.rb:75:in `match'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:282:in `token'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:264:in `lex'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:235:in `block (2 levels) in each_top_level_statement'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:231:in `loop'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:231:in `block in each_top_level_statement'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:230:in `catch'
    from /usr/local/lib/ruby/2.2.0/irb/ruby-lex.rb:230:in `each_top_level_statement'
    from /usr/local/lib/ruby/2.2.0/irb.rb:485:in `eval_input'
    from /usr/local/lib/ruby/2.2.0/irb.rb:395:in `block in start'
    from /usr/local/lib/ruby/2.2.0/irb.rb:394:in `catch'
    from /usr/local/lib/ruby/2.2.0/irb.rb:394:in `start'
    from /usr/local/bin/irb:11:in `<main>'

To be clear, type something on first line (like the comment above) and press enter.
Then on second line follow the instructions:
press Up, Ctrl+U (making last history line empty), Down (to edit current line again), Alt+.
and it immediately crashes.

@Spakman Spakman added good first issue good first issue (probably!) Some of these issues have hidden tentacles... labels Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue (probably!) Some of these issues have hidden tentacles... good first issue
Projects
None yet
Development

No branches or pull requests

2 participants