From 84a76052a03d6e1e9cf0bcc46ba1aa3f10d7fdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 6 Nov 2023 16:55:18 +0100 Subject: [PATCH] Fixed Script editors - tab size now matches indent size --- CHANGELOG.md | 1 + .../jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java | 2 +- .../jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6151f369b..004fd09a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] ### Fixed - [#2021], [#2000] Caret position in editors when using tabs and / or unicode +- Script editors - tab size now matches indent size ## [20.0.0] - 2023-11-05 ### Added diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java index 0bc47d800..e3259755a 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java @@ -376,7 +376,7 @@ public class ASMSourceEditorPane extends DebuggableEditorPane implements CaretLi } super.setText(highlightedText.text); - setCaretPosition(0); + setCaretPosition(0); } @Override diff --git a/src/com/jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java b/src/com/jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java index 3904ef8c5..b42d01426 100644 --- a/src/com/jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java @@ -36,6 +36,7 @@ import javax.swing.text.BadLocationException; import javax.swing.text.Document; import javax.swing.text.EditorKit; import javax.swing.text.JTextComponent; +import javax.swing.text.PlainDocument; import jsyntaxpane.SyntaxDocument; /** @@ -162,6 +163,8 @@ public class UndoFixedEditorPane extends JEditorPane { ((SyntaxDocument) doc).setIgnoreUpdate(false); } + doc.putProperty(PlainDocument.tabSizeAttribute, Configuration.indentSize.get()); + setDocument(doc); } catch (BadLocationException | IOException ex) { Logger.getLogger(UndoFixedEditorPane.class.getName()).log(Level.SEVERE, null, ex);