Browse Source

Skip indentation of empty lines when indenting a selection.

Cheeseness 5 years ago
parent
commit
1f159306ed
1 changed files with 3 additions and 0 deletions
  1. 3 0
      scene/gui/text_edit.cpp

+ 3 - 0
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);