From 871f4f52d96a3390ea396147b543f3babc0c0dac Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Thu, 2 Feb 2017 10:19:33 +0100 Subject: [PATCH] [#1343] AS 1/2 direct editation critical bug --- CHANGELOG.md | 1 + .../flash/gui/action/ActionPanel.java | 32 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) 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); } }