[#1343] AS 1/2 direct editation critical bug

This commit is contained in:
2017-02-02 10:19:33 +01:00
parent 16e1cf3b63
commit 871f4f52d9
2 changed files with 16 additions and 17 deletions
+1
View File
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
### Fixed ### Fixed
- [#1327] P-code editing: error message and syntax highlighting fixed when instruction name contains upper cased letter - [#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 ## [10.0.0] - 2016-12-24
### Added ### Added
@@ -901,24 +901,22 @@ public class ActionPanel extends JPanel implements SearchListener<ActionSearchRe
public void setDecompiledEditMode(boolean val) { public void setDecompiledEditMode(boolean val) {
View.checkAccess(); View.checkAccess();
if (lastASM == null) { if (src != null) {
return; int lastLine = decompiledEditor.getLine();
} int prefLines = src.getPrefixLineCount();
if (val) {
int lastLine = decompiledEditor.getLine(); String newText = src.removePrefixAndSuffix(lastDecompiled.text);
int prefLines = lastASM.getPrefixLineCount(); setDecompiledText(src.getScriptName(), newText);
if (val) { if (lastLine > -1) {
String newText = lastASM.removePrefixAndSuffix(lastDecompiled.text); if (lastLine - prefLines >= 0) {
setDecompiledText(lastASM.getScriptName(), newText); decompiledEditor.gotoLine(lastLine - prefLines + 1);
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);
} }
} }