summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2015-12-01 21:01:05 +0100
committerRémi Verschelde <remi@verschelde.fr>2015-12-01 21:01:05 +0100
commit7b9dd1ea76be34b16c11c8765ef746f27cf25320 (patch)
tree7ab84fa88ca3bd0e28c6e95cd7a8d0075ba5305c /tools/editor/plugins
parentf1f3468f70c85c33f630042670b47401eeee6092 (diff)
parentfc7e313074e9f8b59e186e4f95c2598e3793b2e4 (diff)
Merge pull request #2968 from neikeq/line_duplicate
Fix script editor not clonning down last line
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index e01cf72149..370f26231c 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -1138,8 +1138,8 @@ void ScriptEditor::_menu_option(int p_option) {
int line = tx->cursor_get_line();
int next_line = line + 1;
- if (line == tx->get_line_count() || next_line > tx->get_line_count())
- return;
+ if (line == tx->get_line_count() - 1 || next_line >= tx->get_line_count())
+ tx->set_line(line, tx->get_line(line) + "\n");
String line_clone = tx->get_line(line);
tx->insert_at(line_clone, next_line);