File tree 3 files changed +7
-3
lines changed
jadx-core/src/main/java/jadx/core/codegen
jadx-gui/src/main/java/jadx/gui/ui/codearea
3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,9 @@ public MethodNode getMethodNode() {
81
81
82
82
public boolean addDefinition (ICodeWriter code ) {
83
83
if (mth .getMethodInfo ().isClassInit ()) {
84
+ code .startLine ();
84
85
code .attachDefinition (mth );
85
- code .startLine ("static" );
86
+ code .add ("static" );
86
87
return true ;
87
88
}
88
89
if (mth .contains (AFlag .ANONYMOUS_CONSTRUCTOR )) {
Original file line number Diff line number Diff line change @@ -186,6 +186,10 @@ public int adjustOffsetForWordToken(int offset) {
186
186
if (type == TokenTypes .ANNOTATION && token .length () > 1 ) {
187
187
return token .getOffset () + 1 ;
188
188
}
189
+ if (type == TokenTypes .RESERVED_WORD && token .length () == 6 && token .getLexeme ().equals ("static" )) {
190
+ // maybe a class init method
191
+ return token .getOffset ();
192
+ }
189
193
} else if (type == TokenTypes .MARKUP_TAG_ATTRIBUTE_VALUE ) {
190
194
return token .getOffset () + 1 ; // skip quote at start (")
191
195
}
Original file line number Diff line number Diff line change 6
6
import javax .swing .text .Highlighter ;
7
7
8
8
import org .fife .ui .rsyntaxtextarea .Token ;
9
- import org .fife .ui .rsyntaxtextarea .TokenTypes ;
10
9
import org .fife .ui .rtextarea .SmartHighlightPainter ;
11
10
import org .slf4j .Logger ;
12
11
import org .slf4j .LoggerFactory ;
@@ -44,7 +43,7 @@ private boolean addHighlight(MouseEvent e) {
44
43
}
45
44
try {
46
45
Token token = codeArea .viewToToken (e .getPoint ());
47
- if (token == null || token . getType () != TokenTypes . IDENTIFIER ) {
46
+ if (token == null ) {
48
47
return false ;
49
48
}
50
49
int tokenOffset = token .getOffset ();
You can’t perform that action at this time.
0 commit comments