diff --git a/CHANGELOG.md b/CHANGELOG.md index 5473974b0..bb48fdb5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. ### Fixed - [#1327] P-code editing: error message and syntax highlighting fixed when instruction name contains upper cased letter +- [#1343] AS 1/2 direct editation critical bug ## [10.0.0] - 2016-12-24 ### Added diff --git a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index 392548d96..b34e3c450 100644 --- a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -901,24 +901,22 @@ public class ActionPanel extends JPanel implements SearchListener -1) { - if (lastLine - prefLines >= 0) { - decompiledEditor.gotoLine(lastLine - prefLines + 1); + if (src != null) { + int lastLine = decompiledEditor.getLine(); + int prefLines = src.getPrefixLineCount(); + if (val) { + String newText = src.removePrefixAndSuffix(lastDecompiled.text); + setDecompiledText(src.getScriptName(), newText); + if (lastLine > -1) { + if (lastLine - prefLines >= 0) { + decompiledEditor.gotoLine(lastLine - prefLines + 1); + } + } + } else { + setDecompiledText(src.getScriptName(), lastDecompiled.text); + if (lastLine > -1) { + decompiledEditor.gotoLine(lastLine + prefLines + 1); } - } - } else { - setDecompiledText(lastASM.getScriptName(), lastDecompiled.text); - if (lastLine > -1) { - decompiledEditor.gotoLine(lastLine + prefLines + 1); } }