Skip to content

Commit

Permalink
seems stable
Browse files Browse the repository at this point in the history
  • Loading branch information
neoedmund committed Sep 4, 2022
1 parent 856655e commit c6d86bf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
Binary file modified dist/neoeedit.jar
Binary file not shown.
30 changes: 23 additions & 7 deletions src/neoe/ne/PlainPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ private void doMoveViewUp ( ) {
sy = Math . max ( 0 , sy - 1 ) ;
}

private void doMoveViewPageDown ( ) {
sy = Math . min ( sy + showLineCnt , pageData . roLines . getLinesize ( ) - 1 ) ;
}

private void doMoveViewPageUp ( ) {
sy = Math . max ( 0 , sy - showLineCnt ) ;
}

/* let cursor get see */
public void focusCursor ( ) {
sy = U . between ( U . between ( sy , cy - showLineCnt + 3 , cy - 3 ) , 0 , pageData . roLines . getLinesize ( ) - 1 ) ;
Expand Down Expand Up @@ -541,12 +549,20 @@ void processCommand ( Commands cmd ) throws Exception {
U . reloadWithEncodingByUser ( this ) ;
break ;
case moveLeft :
cursor . moveLeft ( ) ;
focusCursor ( ) ;
if ( readonly )
doMoveViewPageUp ( ) ;
else {
cursor . moveLeft ( ) ;
focusCursor ( ) ;
}
break ;
case moveRight :
cursor . moveRight ( ) ;
focusCursor ( ) ;
if ( readonly )
doMoveViewPageDown ( ) ;
else {
cursor . moveRight ( ) ;
focusCursor ( ) ;
}
break ;
case moveUp :
if ( readonly )
Expand Down Expand Up @@ -574,15 +590,15 @@ void processCommand ( Commands cmd ) throws Exception {
break ;
case movePageUp :
if ( readonly )
sy = Math . max ( 0 , sy - showLineCnt ) ;
doMoveViewPageUp ( ) ;
else {
cursor . movePageUp ( ) ;
focusCursor ( ) ;
}
break ;
case movePageDown :
if ( readonly )
sy = Math . min ( sy + showLineCnt , pageData . roLines . getLinesize ( ) - 1 ) ;
doMoveViewPageDown ( ) ;
else {
cursor . movePageDown ( ) ;
focusCursor ( ) ;
Expand Down Expand Up @@ -812,7 +828,7 @@ void processCommand ( Commands cmd ) throws Exception {

public void repaint ( ) {
new Thread ( ( ) -> uiComp . repaint ( ) ) . start ( ) ;
// SwingUtilities . invokeLater ( ) ;
// SwingUtilities . invokeLater ( ) ;
}

private void unknownCommand ( KeyEvent env ) {
Expand Down
2 changes: 1 addition & 1 deletion src/neoe/ne/U.java
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ public static Commands mappingToCommand ( KeyEvent env ) {
if ( kc == KeyEvent . VK_SHIFT || kc == KeyEvent . VK_CONTROL || kc == KeyEvent . VK_ALT ) // fast pass
return null ;
String name = getKeyName ( env ) ;
// System.out.println("key name=" + name);
// System . out . println ( "key name=" + name ) ;
Commands cmd = keys . get ( name ) ;
return cmd ;
}
Expand Down
2 changes: 1 addition & 1 deletion src/neoe/ne/Version.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package neoe . ne ;

public class Version {
public static final String REV = "v380rc6" . toString ( ) ; // β
public static final String REV = "v380" . toString ( ) ; // β
public static final String CONFIG_FN = "/data.py.ver37" . toString ( ) ;
}

0 comments on commit c6d86bf

Please sign in to comment.