From 60bc48873ee06e70d4614ad7b9346a21e098e46a Mon Sep 17 00:00:00 2001 From: Nathaniel Sabanski Date: Mon, 10 Aug 2026 09:46:04 -0700 Subject: [PATCH 1/2] Fix broken support for .txt .md files. --- .../core/editor/application/create_tool.gd | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/script_splitter/core/editor/application/create_tool.gd b/addons/script_splitter/core/editor/application/create_tool.gd index bd703cf..af15ca1 100644 --- a/addons/script_splitter/core/editor/application/create_tool.gd +++ b/addons/script_splitter/core/editor/application/create_tool.gd @@ -42,8 +42,18 @@ func execute(value : Variant = null) -> bool: if is_instance_valid(root): var mt : MickeyTool = _tools[0].build(control) - var is_editor : bool = _is_editor(mt, control) var doc : bool = false + + if mt == null: + for z : int in range(1, _tools.size(), 1): + var x : EditorTool = _tools[z] + mt = x.build(control) + + if mt != null: + doc = x is HelperEditorTool + break + + var is_editor : bool = _is_editor(mt, control) if !is_editor: for z : int in range(1, _tools.size(), 1): From 84413c7e3f41dcc77323950070fbb18bfc4a0896 Mon Sep 17 00:00:00 2001 From: Nathaniel Sabanski Date: Mon, 10 Aug 2026 09:56:02 -0700 Subject: [PATCH 2/2] Be more obvious when _build_tool() will return null. --- .../script_splitter/core/editor/tools/text_editor_tool.gd | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/script_splitter/core/editor/tools/text_editor_tool.gd b/addons/script_splitter/core/editor/tools/text_editor_tool.gd index 1d51c4e..040d0b6 100644 --- a/addons/script_splitter/core/editor/tools/text_editor_tool.gd +++ b/addons/script_splitter/core/editor/tools/text_editor_tool.gd @@ -11,12 +11,10 @@ extends "./../../../core/editor/tools/editor_tool.gd" func _build_tool(control : Node) -> MickeyTool: if control is ScriptEditorBase: var editor : Control = control.get_base_editor() - var mickey_tool : MickeyTool = null if editor is CodeEdit: var parent : Node = control.get_parent() if parent != null and parent.is_node_ready() and !control.get_parent() is VSplitContainer: - mickey_tool = MickeyTool.new(control, editor, editor) + return MickeyTool.new(control, editor, editor) else: - mickey_tool = MickeyTool.new(control, editor, editor) - return mickey_tool + return MickeyTool.new(control, editor, editor) return null