summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-11-14 07:33:04 +0100
committerGitHub <noreply@github.com>2017-11-14 07:33:04 +0100
commit468567438974ccfea11bcd5525cdeece3e1e546a (patch)
tree5240385cff7d7b2a2efe0c13f602c3d0eb955c97 /scene/gui
parenta14f9c2dcad6468f95a318c245dbf2edeb618133 (diff)
parent94b3e786cd9d23ef972d366333abfbcfb1f7b989 (diff)
Merge pull request #12842 from ianb96/shader_editor_fix
Shader Editor context menu and line operations and style fix
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/text_edit.cpp7
-rw-r--r--scene/gui/text_edit.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 02b203b5e3..5d429f9f91 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3905,7 +3905,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 b90571e0ab..50f005ed6a 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -464,6 +464,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);