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

Multiline history #76

Closed
leejarvis opened this issue Apr 24, 2011 · 7 comments
Closed

Multiline history #76

leejarvis opened this issue Apr 24, 2011 · 7 comments
Labels

Comments

@leejarvis
Copy link

This would be non-trivial, but very cool, and would separate Pry from most other REPLs

See the comment here from kzar:

Do any of these IRB alternatives support multi-line history? I want to define a function, press up and have the whole function definition there instead of the last line of it -- how it works with Clojure's REPL.

@epitron
Copy link
Member

epitron commented Apr 24, 2011

Yep, this is one of the first things I suggested.

The simplest method would be to reimplement readline in curses. It wouldn't be too hard if we just implemented the default keymap... but readline has some kind of input-rc file where you can remap all the keys. Supporting all the weird readline features might get hairy.

Of course, we could just make the multiline input use the default readline keys, and give users who want to customize it the option of using the old readline method... once we have a config file. :)

@epitron
Copy link
Member

epitron commented Apr 24, 2011

Oh, I was also interested in working on a GUI frontend to Pry (using GTK), which should (in theory) make multiline readline simple. :)

@henrikh
Copy link

henrikh commented Apr 27, 2011

@epitron the question is if all those features are needed?
Having the ability to chose different front-ends would also be useful.

@epitron
Copy link
Member

epitron commented Apr 27, 2011

Well, I know a lot of people like to switch from standard readline keymap to vi-keymap. That feature alone would require most of the full input-rc parsing, I believe. :)

@banister
Copy link
Member

This can kind of be implemented by joining the appropriate lines with "\n" and writing to the proper element in Readline::HISTORY see: https://github.com/janlelis/ripl-multi_line/blob/master/lib/ripl/multi_line.rb

@epitron
Copy link
Member

epitron commented Apr 28, 2011

So, readline will output multiple lines if you navigate to a history entry with \n's in it?

And I suppose, you'd then use the horizontal navigation keys (left, right, home, end, Alt-F/B) to edit to the previous lines?

@banister
Copy link
Member

banister commented Dec 8, 2011

We've decided against this for the same reasons as IPython, we also have the edit command and edit --in which bring up actual editors with real multiline editing ;)

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

No branches or pull requests

4 participants