summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-01-17 09:42:06 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-01-17 09:42:06 -0300
commitbe7d8a182c066bf61a01635c83a80288c537325f (patch)
tree810ee9d065656410a33f92338f2545a2e531b291 /tools
parent9ce885ccd82d16e9fcda5a39148522e0b298f8d0 (diff)
parentd2a0f86d9fd7c3795af397a0a6ad878f67c35bdd (diff)
Merge pull request #1225 from marynate/PR-script-editor-close-tab
Only show Close Tab confirmation when script has unsaved change
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 29f25e9175..d90597ddfb 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -188,7 +188,7 @@ void ScriptTextEditor::apply_code() {
if (script.is_null())
return;
- print_line("applying code");
+// print_line("applying code");
script->set_source_code(get_text_edit()->get_text());
script->update_exports();
}
@@ -1034,9 +1034,12 @@ void ScriptEditor::_menu_option(int p_option) {
editor->emit_signal("request_help", text);
} break;
case WINDOW_CLOSE: {
-
- erase_tab_confirm->set_text("Close Tab?:\n\""+current->get_name()+"\"");
- erase_tab_confirm->popup_centered(Point2(250,80));
+ if (current->get_text_edit()->get_version()!=current->get_text_edit()->get_saved_version()) {
+ erase_tab_confirm->set_text("Close and save changes?\n\""+current->get_name()+"\"");
+ erase_tab_confirm->popup_centered(Point2(250,80));
+ } else {
+ _close_current_tab();
+ }
} break;
case WINDOW_MOVE_LEFT: {