From 8ff747171f019aa1004db2a6aa37eb51ae932928 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 28 May 2018 16:52:28 +0100 Subject: Allow opening and editing of any utf_8 file in script editor --- editor/plugins/script_editor_plugin.cpp | 373 +++++++++++++++----- editor/plugins/script_editor_plugin.h | 20 +- editor/plugins/script_text_editor.cpp | 54 +-- editor/plugins/script_text_editor.h | 5 +- editor/plugins/text_editor.cpp | 607 ++++++++++++++++++++++++++++++++ editor/plugins/text_editor.h | 146 ++++++++ 6 files changed, 1088 insertions(+), 117 deletions(-) create mode 100644 editor/plugins/text_editor.cpp create mode 100644 editor/plugins/text_editor.h (limited to 'editor/plugins') diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 876da7f61a..a1dc746702 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -31,7 +31,6 @@ #include "script_editor_plugin.h" #include "core/io/resource_loader.h" -#include "core/io/resource_saver.h" #include "core/os/file_access.h" #include "core/os/input.h" #include "core/os/keyboard.h" @@ -283,7 +282,6 @@ void ScriptEditor::_breaked(bool p_breaked, bool p_can_debug) { ScriptEditorBase *se = Object::cast_to(tab_container->get_child(i)); if (!se) { - continue; } @@ -402,7 +400,10 @@ void ScriptEditor::_go_to_tab(int p_idx) { if (is_visible_in_tree()) Object::cast_to(c)->ensure_focus(); - notify_script_changed(Object::cast_to(c)->get_edited_script()); + Ref