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

[Truffle] Implement readline #3917

Merged
merged 40 commits into from
May 24, 2016
Merged

[Truffle] Implement readline #3917

merged 40 commits into from
May 24, 2016

Conversation

nirvdrum
Copy link
Contributor

@jruby/truffle

This isn't 100% on par with what JRuby has, but it's pretty close. It fixes the biggest usability problem I've had with IRB in JRuby+Truffle: the arrow keys don't work. Now you can scroll through history and move between characters on the same line.

nirvdrum added 30 commits May 23, 2016 15:44
…a primitive.

The primitive system is a bit too fickle for this use case.
I'm really not sure how well this will work cross-contexts, but perhaps if readline is being source by something other than STDIN this will be valuable. It's cleaner in any event.
The full form of this method takes an offset and length, but it's not clear that JLine supports this.
nirvdrum added 3 commits May 23, 2016 15:44
Note that we don't currently support this in JRuby+Truffle, but I've retained the structure to make porting easier in the future.
@nirvdrum nirvdrum added this to the truffle-dev milestone May 23, 2016
@nirvdrum nirvdrum changed the title Truffle readline [Truffle] Implement readline May 23, 2016
public DynamicObject each(VirtualFrame frame, DynamicObject history, DynamicObject block) {
final ConsoleHolder consoleHolder = getContext().getConsoleHolder();

for (Iterator<History.Entry> i = consoleHolder.getHistory().iterator(); i.hasNext();) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a for-each loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. I meant to, but forgot as I transposed.

}


}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pitr-ch
Copy link
Member

pitr-ch commented May 24, 2016

LGTM, only minor: could you split some of the long lines.

@nirvdrum nirvdrum merged commit b4449fb into master May 24, 2016
@nirvdrum nirvdrum deleted the truffle_readline branch May 24, 2016 17:11
nirvdrum added a commit that referenced this pull request May 27, 2016
This reverts commit b4449fb, reversing
changes made to 1571d31.
nirvdrum added a commit that referenced this pull request Dec 12, 2016
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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

Successfully merging this pull request may close these issues.

None yet

5 participants