Skip to content

Commit 2c63b7b

Browse files
committed
Highlightable tokens
1 parent 7e8356f commit 2c63b7b

File tree

7 files changed

+6340
-10
lines changed

7 files changed

+6340
-10
lines changed

src/main/java/club/bytecode/the/jda/JDA.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import club.bytecode.the.jda.gui.MainViewerGUI;
88
import club.bytecode.the.jda.gui.fileviewer.BytecodeFoldParser;
99
import club.bytecode.the.jda.gui.fileviewer.BytecodeTokenizer;
10+
import club.bytecode.the.jda.gui.fileviewer.JDAJavaTokenizer;
1011
import club.bytecode.the.jda.gui.fileviewer.ViewerFile;
1112
import club.bytecode.the.jda.gui.navigation.FileNavigationPane;
1213
import club.bytecode.the.jda.settings.Settings;
@@ -15,6 +16,7 @@
1516
import org.apache.commons.io.FileUtils;
1617
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
1718
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
19+
import org.fife.ui.rsyntaxtextarea.folding.CurlyFoldParser;
1820
import org.fife.ui.rsyntaxtextarea.folding.FoldParserManager;
1921
import org.objectweb.asm.ClassWriter;
2022
import org.objectweb.asm.tree.ClassNode;
@@ -131,7 +133,9 @@ else if (!pluginsDir.isDirectory())
131133
public static void onGUILoad() {
132134
AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory)TokenMakerFactory.getDefaultInstance();
133135
atmf.putMapping(BytecodeTokenizer.SYNTAX_STYLE_BYTECODE, BytecodeTokenizer.class.getName());
136+
atmf.putMapping(JDAJavaTokenizer.SYNTAX_STYLE_JDA_JAVA, JDAJavaTokenizer.class.getName());
134137
FoldParserManager.get().addFoldParserMapping(BytecodeTokenizer.SYNTAX_STYLE_BYTECODE, new BytecodeFoldParser());
138+
FoldParserManager.get().addFoldParserMapping(JDAJavaTokenizer.SYNTAX_STYLE_JDA_JAVA, new CurlyFoldParser());
135139

136140
plugins.forEach(JDAPlugin::onGUILoad);
137141
}

src/main/java/club/bytecode/the/jda/gui/fileviewer/DecompileThread.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import club.bytecode.the.jda.decompilers.filter.DecompileFilter;
88
import com.strobel.annotations.Nullable;
99
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
10-
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
1110
import org.fife.ui.rtextarea.RTextScrollPane;
1211
import org.objectweb.asm.tree.ClassNode;
1312

@@ -53,7 +52,6 @@ public void run() {
5352
panelArea = new BytecodeSyntaxArea(text);
5453
} else {
5554
panelArea = new JDATextArea(text);
56-
panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
5755
}
5856

5957
final RTextScrollPane scrollPane = new RTextScrollPane(panelArea);

0 commit comments

Comments
 (0)