From 8faf44a0fa9de6b52ba9493ad3465d303e03a8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 30 Sep 2023 21:47:47 +0200 Subject: [PATCH] Hilighting first class trait - conflicting with script initializer --- src/com/jpexs/decompiler/flash/gui/MainPanel.java | 2 -- .../jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 9fe8d4fcb..bb421fc76 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -2449,10 +2449,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se public void run() { if (abcPanel != null) { abcPanel.decompiledTextArea.removeScriptListener(this); - boolean classChanged = false; if (abcPanel.decompiledTextArea.getClassIndex() != classIndex) { abcPanel.decompiledTextArea.setClassIndex(classIndex); - classChanged = true; } if (traitIndex != -10) { abcPanel.decompiledTextArea.gotoTrait(traitIndex); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 03d96aa44..734178a48 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -786,7 +786,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL continue looph; } } - final int fpos = th.startPos; + final int fpos = th.startPos + 1; //+1 to skip script initializer which is on first character new Timer().schedule(new TimerTask() { @Override public void run() {