diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-03-14 17:12:15 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-03-14 17:12:15 +0100 |
commit | c30bebd1d3d10f705eae339a684e439edc052195 (patch) | |
tree | aa1a3cd550b5bd1ba6a18261230b841a2be16bc6 /scene | |
parent | ad29ee328d5d4f1e08fb20248aa4a8ae5fd6c380 (diff) | |
parent | 9234bd3ff9a3ff025368a1882ccfb91ca1b96ff1 (diff) |
Merge pull request #4017 from Paulb23/set_tab_size
Added configurable tab size in the text editor.
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/text_edit.cpp | 7 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 05e49a5104..e268375c8a 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3507,6 +3507,13 @@ void TextEdit::_push_current_op() { } +void TextEdit::set_tab_size(const int p_size) { + ERR_FAIL_COND(p_size <= 0); + tab_size = p_size; + text.set_tab_size(p_size); + update(); +} + void TextEdit::set_draw_tabs(bool p_draw) { draw_tabs=p_draw; diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 207d6eb131..d38c57804d 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -379,7 +379,7 @@ public: void redo(); void clear_undo_history(); - + void set_tab_size(const int p_size); void set_draw_tabs(bool p_draw); bool is_drawing_tabs() const; |