correct marking error position

This commit is contained in:
Jindra Petřík
2014-10-28 21:15:07 +01:00
parent 181c77c7dd
commit d7bbfe265d
5 changed files with 88 additions and 37 deletions

View File

@@ -774,12 +774,14 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
//reload();
} catch (AVM2ParseException ex) {
abc.script_info.get(oldIndex).delete(abc, false);
View.showMessageDialog(this, AppStrings.translate("error.action.save").replace("%error%", ex.text).replace("%line%", "" + ex.line), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
decompiledTextArea.gotoLine((int) ex.line);
decompiledTextArea.markError();
View.showMessageDialog(this, AppStrings.translate("error.action.save").replace("%error%", ex.text).replace("%line%", "" + ex.line), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
} catch (CompilationException ex) {
abc.script_info.get(oldIndex).delete(abc, false);
View.showMessageDialog(this, AppStrings.translate("error.action.save").replace("%error%", ex.text).replace("%line%", "" + ex.line), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
decompiledTextArea.gotoLine((int) ex.line);
decompiledTextArea.markError();
View.showMessageDialog(this, AppStrings.translate("error.action.save").replace("%error%", ex.text).replace("%line%", "" + ex.line), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
} catch (IOException | InterruptedException ex) {
//ignore
}