Explorar o código

Fix script editor not clonning down last line

neikeq %!s(int64=9) %!d(string=hai) anos
pai
achega
fc7e313074
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      tools/editor/plugins/script_editor_plugin.cpp

+ 2 - 2
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);