diff options
author | Ian <ianb96@gmail.com> | 2017-11-10 23:07:41 -0500 |
---|---|---|
committer | Ian <ianb96@gmail.com> | 2017-11-11 14:46:59 -0500 |
commit | 94b3e786cd9d23ef972d366333abfbcfb1f7b989 (patch) | |
tree | 8a813a47b0d1853ba16695dbfa08a5202fae23f6 /scene | |
parent | fc299b4f370d586b75e1ae4f394cd3759ea4ae49 (diff) |
shader editor context menu and line operations and style fix
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/text_edit.cpp | 7 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f4876668f6..5d4048f928 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3900,7 +3900,12 @@ void TextEdit::select(int p_from_line, int p_from_column, int p_to_line, int p_t update(); } - +void TextEdit::swap_lines(int line1, int line2) { + String tmp = get_line(line1); + String tmp2 = get_line(line2); + set_line(line2, tmp); + set_line(line1, tmp2); +} bool TextEdit::is_selection_active() const { return selection.active; diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 094474b264..c81b41c2e3 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -463,6 +463,7 @@ public: void select_all(); void select(int p_from_line, int p_from_column, int p_to_line, int p_to_column); void deselect(); + void swap_lines(int line1, int line2); void set_search_text(const String &p_search_text); void set_search_flags(uint32_t p_flags); |