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

Readline::HISTORY.delete_at(index) not working for indices of negative values #161

Open
pingport80 opened this issue Apr 18, 2021 · 0 comments

Comments

@pingport80
Copy link

pingport80 commented Apr 18, 2021

Summary

Readline::HISTORY.delete_at method not working for indices of negative values.

Steps to Reproduce

irb
require 'readline'
Readline::HISTORY.push('a')
=> ["a"]
Readline::HISTORY.push('b')
=> ["b"]
Readline::HISTORY.push('c')
=> ["c"]
>> Readline::HISTORY.delete_at(-1)
/var/lib/gems/2.7.0/gems/rb-readline-0.5.5/lib/readline.rb:458:in `delete_at': undefined method `+' for nil:NilClass (NoMethodError)

Additional Information

    def self.delete_at(index)
      if index < 0
        i += RbReadline.history_length

i variable is not defined here, which I think is causing the problem. I guess it was meant to be index.

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