diff options
-rw-r--r-- | drivers/png/resource_saver_png.cpp | 1 | ||||
-rw-r--r-- | platform/x11/detect.py | 2 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 13 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 2 | ||||
-rw-r--r-- | tools/editor/code_editor.cpp | 1 |
5 files changed, 18 insertions, 1 deletions
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index 76e0c03c46..581efb5adc 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -214,6 +214,7 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { memdelete(f); /* cleanup heap allocation */ + png_destroy_write_struct(&png_ptr, &info_ptr); return OK; } diff --git a/platform/x11/detect.py b/platform/x11/detect.py index a37005738a..d996587864 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -118,6 +118,8 @@ def configure(env): elif (env["target"]=="release_debug"): env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED']) + if (env["debug_release"]=="yes"): + env.Append(CCFLAGS=['-g2']) elif (env["target"]=="debug"): diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 5415484009..78792dc785 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1610,6 +1610,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { else break; } + if(auto_indent){ + // indent once again if previous line will end with ':' + // (i.e. colon precedes current cursor position) + if(cursor.column>0 && text[cursor.line][cursor.column-1]==':') { + ins+="\t"; + } + } _insert_text_at_cursor(ins); _push_current_op(); @@ -2869,6 +2876,10 @@ bool TextEdit::is_syntax_coloring_enabled() const { return syntax_coloring; } +void TextEdit::set_auto_indent(bool p_auto_indent) { + auto_indent = p_auto_indent; +} + void TextEdit::cut() { if (!selection.active) @@ -3836,7 +3847,7 @@ TextEdit::TextEdit() { next_operation_is_complex=false; auto_brace_completion_enabled=false; brace_matching_enabled=false; - + auto_indent=false; } TextEdit::~TextEdit() diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 059e15dcff..91369309cf 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -213,6 +213,7 @@ class TextEdit : public Control { bool auto_brace_completion_enabled; bool brace_matching_enabled; + bool auto_indent; bool cut_copy_line; uint64_t last_dblclk; @@ -323,6 +324,7 @@ public: brace_matching_enabled=p_enabled; update(); } + void set_auto_indent(bool p_auto_indent); void cursor_set_column(int p_col, bool p_adjust_viewport=true); void cursor_set_line(int p_row, bool p_adjust_viewport=true); diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 685763cadb..0728b3b7c1 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -614,6 +614,7 @@ CodeTextEditor::CodeTextEditor() { text_editor->add_font_override("font",get_font("source","Fonts")); text_editor->set_show_line_numbers(true); text_editor->set_brace_matching(true); + text_editor->set_auto_indent(true); line_col = memnew( Label ); add_child(line_col); |