Fix script editor not clonning down last line

This commit is contained in:
neikeq 2015-11-30 15:41:04 +01:00
parent 772900c4ff
commit fc7e313074
1 changed files with 2 additions and 2 deletions

View File

@ -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);