|
|
|
|
|
by cldwalker
5533 days ago
|
|
I just implemented it for ripl, http://github.com/cldwalker/ripl, in two ways: https://gist.github.com/939846. First way would put it in your history as a one-liner. The second would let you edit the last code block in your editor. The gist shows an example. If you want to try this out, simply `gem install ripl ripl-multi_line` and add the gist to ~/.riplrc. Since this is a hack, I would open an issue on https://github.com/janlelis/ripl-multi_line/issues if you want it to be done properly. If you were talking about using readline's multi-line history, I'm not sure if ruby's readline library has an api to it. Would be useful. |
|
You can change the behavior with the Ripl.config[:multi_line_history] option. Possible values: * :compact - transform the last statement into a ; separated one-liner * :block - just join the last multi-line statement to one block ("\n") * :blank - do nothing