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

Controls break when accessing endless range #1

Open
izzergh opened this issue Feb 15, 2022 · 0 comments
Open

Controls break when accessing endless range #1

izzergh opened this issue Feb 15, 2022 · 0 comments

Comments

@izzergh
Copy link

izzergh commented Feb 15, 2022

When inspecting an endless range (introduced in Ruby 2.6), everything works until typing ( or o. Then the user input is simply written on top of the view.

Steps to recreate:

  1. load irb
require 'scryglass'
(1..).scry
  1. (optional) confirm scryglass is otherwise working fine - try sending begin or end via c, or returning the object with return, or quitting with q
  2. input o or (
  3. try doing anything

The workaround if one finds themself in this situation is to background the irb session ctrl+z and kill the process with kill.

Possible solutions

  1. Lock the Ruby dependency to < 2.6
  2. Check for endless ranges before listing the elements. This can be done by checking begin and end - if either are nil, you have an infinite range on your hands (ruby 2.7 introduces begin-less ranges, iirc). Then simply implement lazy rendering. Or just tell the user "this is infinite! feel free to send methods with c, but you cannot see all elements"
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