mirror of
https://github.com/SuspiciousActivity/ByteEdit.git
synced 2026-08-13 17:56:17 +00:00
Fix for decompilers being editable
This commit is contained in:
1 parent
97422300c8
commit
a0b955a6ae
1 file changed
+15
-15
@@ -663,22 +663,20 @@ public class Main extends JFrame {
|
||||
EnumDecompiler selected = (EnumDecompiler) e.getItem();
|
||||
SingleThreadedExecutor.submit(() -> {
|
||||
decompiler = selected;
|
||||
if (currentNodeName != null) {
|
||||
decompileCurrentNode();
|
||||
try {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
synchronized (treeLock) {
|
||||
txtByteEditView.setCaretPosition(0);
|
||||
try {
|
||||
txtByteEditView.setSyntaxEditingStyle(decompiler.getSyntaxStyle());
|
||||
} catch (Throwable t) {
|
||||
}
|
||||
txtByteEditView.setEditable(decompiler.isEditable());
|
||||
decompileCurrentNode();
|
||||
try {
|
||||
EventQueue.invokeAndWait(() -> {
|
||||
synchronized (treeLock) {
|
||||
txtByteEditView.setCaretPosition(0);
|
||||
try {
|
||||
txtByteEditView.setSyntaxEditingStyle(decompiler.getSyntaxStyle());
|
||||
} catch (Throwable t) {
|
||||
}
|
||||
});
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
txtByteEditView.setEditable(decompiler.isEditable());
|
||||
}
|
||||
});
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -781,6 +779,8 @@ public class Main extends JFrame {
|
||||
}
|
||||
|
||||
public static void decompileCurrentNode() {
|
||||
if (currentNodeName == null)
|
||||
return;
|
||||
try {
|
||||
EnumDecompiler decompiler = Main.decompiler;
|
||||
String current = currentNodeName;
|
||||
|
||||
Reference in new issue
Block a user