RFR: 8133549: Generalize jshell's EditingHistory

Jan Lahoda jan.lahoda at oracle.com
Tue May 17 21:47:53 UTC 2016


I realized I've forgot to do some cleanup in ConsoleIOContext: the new 
EditingHistory in jdk.internal.le is registering shortcuts for itself, 
so the ConsoleIOContext does not need to register the shortcuts anymore.

Updated webrev:
http://cr.openjdk.java.net/~jlahoda/8133549/langtools/webrev.01/

Delta webrev since the previous iteration:
http://cr.openjdk.java.net/~jlahoda/8133549/langtools/webrev.01/delta/webrev/

Does this look OK?

Thanks,
     Jan

On 13.5.2016 19:18, Robert Field wrote:
> Thumbs up on langtools changes
>
> -Robert
>
> On 05/12/16 03:25, Jan Lahoda wrote:
>> Hello,
>>
>> In jshell, there's a special history mode that is intended to aid with
>> editing/re-entering multi-line snippets (EditingHistory). It works
>> like this: when the user goes back through the history to the first
>> line of a multi-line snippet, and enters/confirms that line, the
>> history view is limited only to the given snippet. I.e. up and down
>> arrows won't go through the whole history, but only the few lines of
>> the given snippet. When the multi-line snippet is finished, the
>> history is restored to the original full state.
>>
>> The proposal here is to generalize this history mode so that it can be
>> used in jjs as well. For this, a new support class is added into
>> jdk.internal.le, that implements this history. Also, ConsoleReader is
>> extended to also accept actions as a Runnable instead of only
>> ActionListener, so that the EditingHistory can add extra actions to
>> jump by the whole snippets when going back in history.
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8133549
>>
>> Webrev:
>> jdk repository:
>> http://cr.openjdk.java.net/~jlahoda/8133549/jdk/webrev.00/
>>
>> langtools repository:
>> http://cr.openjdk.java.net/~jlahoda/8133549/langtools/webrev.00/
>>
>> nashorn repository:
>> http://cr.openjdk.java.net/~jlahoda/8133549/nashorn/webrev.00/
>>
>> Any comments are welcome!
>>
>> Thanks,
>>     Jan
>


More information about the kulla-dev mailing list