Fixed: AS3 p-code/AS hilighting when outside trait

This commit is contained in:
Jindra Petřík
2021-02-28 09:07:52 +01:00
parent 81a0f84cbd
commit a4b2d2e31b
2 changed files with 8 additions and 12 deletions

View File

@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
- SWF is not garbage collected on close in some situations
- AS1/2 script search does not show all results
- #1633 AS3 decompilation - return in for..in clause
- AS3 p-code/AS hilighting when outside trait
### Removed
- #1631 ActiveX Flash component download in windows installer

View File

@@ -176,19 +176,14 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
if (currentMethodHighlight == null) {
return;
}
for (Highlighting h : highlightedText.getTraitHighlights()) {
if (h.getProperties().index == lastTraitIndex) {
Highlighting h2 = Highlighting.searchOffset(highlightedText.getInstructionHighlights(), offset, h.startPos, h.startPos + h.len);
if (h2 != null) {
ignoreCarret = true;
if (h2.startPos <= getDocument().getLength()) {
setCaretPosition(h2.startPos);
}
getCaret().setVisible(true);
ignoreCarret = false;
}
Highlighting h2 = Highlighting.searchOffset(highlightedText.getInstructionHighlights(), offset, currentMethodHighlight.startPos, currentMethodHighlight.startPos + currentMethodHighlight.len);
if (h2 != null) {
ignoreCarret = true;
if (h2.startPos <= getDocument().getLength()) {
setCaretPosition(h2.startPos);
}
getCaret().setVisible(true);
ignoreCarret = false;
}
}