mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-24 22:50:45 +00:00
Fixed: AS3 highlighter - links to other scripts with short names
This commit is contained in:
@@ -39,6 +39,7 @@ import com.jpexs.decompiler.flash.gui.Main;
|
||||
import com.jpexs.decompiler.flash.gui.View;
|
||||
import com.jpexs.decompiler.flash.gui.editor.DebuggableEditorPane;
|
||||
import com.jpexs.decompiler.flash.gui.editor.LinkType;
|
||||
import com.jpexs.decompiler.flash.gui.editor.VariableMarker;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.HighlightedText;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightData;
|
||||
@@ -359,7 +360,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
return false;
|
||||
}*/
|
||||
SyntaxDocument sd = (SyntaxDocument) getDocument();
|
||||
Token t = sd.getTokenAt(pos + 1);
|
||||
Token t = VariableMarker.getIdentifierTokenAt(sd, pos); //sd.getTokenAt(pos + 1);
|
||||
Token lastToken = t;
|
||||
Token prev;
|
||||
String propName = t.getString(sd);
|
||||
|
||||
@@ -182,7 +182,7 @@ public class VariableMarker implements SyntaxComponent, CaretListener, PropertyC
|
||||
Markers.removeMarkers(pane, errorMarker);
|
||||
}
|
||||
|
||||
private Token getIdentifierTokenAt(SyntaxDocument sDoc, int pos) {
|
||||
public static Token getIdentifierTokenAt(SyntaxDocument sDoc, int pos) {
|
||||
Token thisToken = sDoc.getTokenAt(pos);
|
||||
if (thisToken != null && (thisToken.type == TokenType.IDENTIFIER || thisToken.type == TokenType.REGEX || thisToken.type == TokenType.KEYWORD)) {
|
||||
return thisToken;
|
||||
@@ -204,7 +204,7 @@ public class VariableMarker implements SyntaxComponent, CaretListener, PropertyC
|
||||
return getNearestTokenAt(sDoc, pos);
|
||||
}
|
||||
|
||||
private Token getNearestTokenAt(SyntaxDocument sDoc, int pos) {
|
||||
private static Token getNearestTokenAt(SyntaxDocument sDoc, int pos) {
|
||||
Token thisToken = sDoc.getTokenAt(pos);
|
||||
if (thisToken != null) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user