From 1f159306ed4068b364fbbd25507ad67ec736f589 Mon Sep 17 00:00:00 2001 From: Cheeseness Date: Fri, 14 Aug 2020 23:53:34 +1000 Subject: [PATCH] Skip indentation of empty lines when indenting a selection. --- scene/gui/text_edit.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a17fdd06510..d6d8e747484 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1872,6 +1872,9 @@ void TextEdit::indent_right() { for (int i = start_line; i <= end_line; i++) { String line_text = get_line(i); + if (line_text.size() == 0 && is_selection_active()) { + continue; + } if (indent_using_spaces) { // We don't really care where selection is - we just need to know indentation level at the beginning of the line. int left = _find_first_non_whitespace_column_of_line(line_text);