Merge pull request #34311 from mikkac/34289

Fix- using cut in first line of a script file does not remove the line
This commit is contained in:
Rémi Verschelde 2019-12-16 08:48:47 +01:00 committed by GitHub
commit 51ab6a96fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5177,11 +5177,16 @@ void TextEdit::cut() {
OS::get_singleton()->set_clipboard(clipboard);
cursor_set_line(cursor.line);
cursor_set_column(0);
_remove_text(cursor.line, 0, cursor.line, text[cursor.line].length());
backspace_at_cursor();
if (cursor.line == 0 && get_line_count() > 1) {
_remove_text(cursor.line, 0, cursor.line + 1, 0);
} else {
_remove_text(cursor.line, 0, cursor.line, text[cursor.line].length());
backspace_at_cursor();
cursor_set_line(cursor.line + 1);
}
update();
cursor_set_line(cursor.line + 1);
cut_copy_line = clipboard;
} else {