Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
neoedmund committed Aug 10, 2022
1 parent 4a84e9f commit 3eeac2f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
Binary file modified dist/neoeedit.jar
Binary file not shown.
1 change: 1 addition & 0 deletions src/neoe/ne/PlainPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public void go ( String line , boolean newWindow ) throws Exception {
if ( pageData . searchResultOf == null || ! gotoFileLineSearchResult ( uiComp , line , pageData . searchResultOf ) )
if ( ! gotoFileLine ( line , uiComp , true ) )
if ( ! U . listDirOrOpenFile ( PlainPage . this , cy ) )
if ( ! Plugin . goHandle ( line , PlainPage . this ) )
U . launch ( line ) ;
uiComp . newWindow = false ;
}
Expand Down
17 changes: 16 additions & 1 deletion src/neoe/ne/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public interface PluginAction {
void run ( PlainPage pp ) throws Exception ;
}

public interface GoHandle {
boolean run ( String line , PlainPage pp ) ;
}

public interface PluginCall {
Object run ( Object pp ) throws Exception ;
}
Expand All @@ -88,7 +92,8 @@ public interface PluginCall {

public static Object call ( String key , Object param ) throws Exception {
PluginCall pc = calls . get ( key ) ;
if ( pc == null ) return null ;
if ( pc == null )
return null ;
return pc . run ( param ) ;
}

Expand Down Expand Up @@ -118,4 +123,14 @@ public static String registerCmd ( String key0 , PluginAction pa ) {
U . pluginKeys . put ( key , pa ) ;
return null ;
}

public static List < GoHandle > goHandles = new ArrayList < > ( ) ;

public static boolean goHandle ( String line , PlainPage pp ) {
for ( GoHandle h : goHandles ) {
if ( h . run ( line , pp ) )
return true ;
}
return false ;
}
}
11 changes: 9 additions & 2 deletions src/neoe/ne/U.java
Original file line number Diff line number Diff line change
Expand Up @@ -862,10 +862,17 @@ private static void addCmdHistory ( String cmd , String path ) throws IOExceptio
} else if ( c == ' ' || c == '\t' ) {
p1 ++ ;
} else {
int p2 = s . indexOf ( ' ' , p1 + 1 ) ;
int p2 = -1 ;
for ( int i = p1 + 1 ; i < s . length ( ) ; i ++ ) {
char c3 = s . charAt ( i ) ;
if ( c3 == ' ' || c3 == '\t' ) {
p2 = i ;
break ;
}
}
if ( p2 < 0 )
p2 = len ;
r . add ( s . substring ( p1 , p2 ) ) ;
r . add ( s . substring ( p1 , p2 ) . trim ( ) ) ;
p1 = p2 + 1 ;
}
}
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 = "v380rc3" . toString ( ) ; // β
public static final String REV = "v380rc4" . toString ( ) ; // β
public static final String CONFIG_FN = "/data.py.ver37" . toString ( ) ;
}

0 comments on commit 3eeac2f

Please sign in to comment.