On Fri, 8 Jul 2022 08:26:43 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> Unlike in native "Notes" editor where Option+Up/Down traverses to start/end 
>> of each line respectively,
>> Java does not honour these key combination in editor.
>> 
>> Added the key combination support by moving the caret to start/end of line 
>> and then doing caret up/down a line depending on if we are pressing UP or 
>> DOWN key.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Remove altgraph mapping

Changes requested by prr (Reviewer).

src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java line 648:

> 646:      * Name of the <code>Action</code> for moving the caret
> 647:      * to the begin of a line it not at the begin already or
> 648:      * upward one line otherwise.

begin -> beginning (or write start instead)
and I think you mean "if not" not "it not"
Also use {@code Action}
So in all
* Name of the {@code Action} for moving the caret to the beginning of the 
current line,
* or up to the beginning of the previous line if the caret is already at the 
beginning of the line.
*

src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java line 657:

> 655:      * to the end of a line if not at the end already
> 656:      * or downward one line otherwise.
> 657:      * @see #getActions

* Name of the {@code Action} for moving the caret to the end of the current 
line,
* or down to the end of the next line if the caret is already at the end of the 
line.

src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java line 2089:

> 2087:         @SuppressWarnings("deprecation")
> 2088:         public void actionPerformed(ActionEvent e) {
> 2089:             System.out.println("EndLineDownAction");

remove the println

src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java line 2110:

> 2108: 
> 2109:                         if (magicPosition == null && (direction == 
> SwingConstants.NORTH || direction == SwingConstants.SOUTH)) {
> 2110:                             Rectangle r = (bidiCaret != null) ?

break this line

-------------

PR: https://git.openjdk.org/jdk/pull/9230

Reply via email to