Procházet zdrojové kódy

Fixed undo when converting indent with no changes, issue 9841

Paulb23 před 8 roky
rodič
revize
e91bde6521
1 změnil soubory, kde provedl 6 přidání a 2 odebrání
  1. 6 2
      editor/plugins/script_text_editor.cpp

+ 6 - 2
editor/plugins/script_text_editor.cpp

@@ -355,7 +355,9 @@ void ScriptTextEditor::convert_indent_to_spaces() {
 			}
 			j++;
 		}
-		tx->set_line(i, line);
+		if (changed_indentation) {
+			tx->set_line(i, line);
+		}
 	}
 	if (changed_indentation) {
 		tx->cursor_set_column(cursor_column);
@@ -409,7 +411,9 @@ void ScriptTextEditor::convert_indent_to_tabs() {
 			}
 			j++;
 		}
-		tx->set_line(i, line);
+		if (changed_indentation) {
+			tx->set_line(i, line);
+		}
 	}
 	if (changed_indentation) {
 		tx->cursor_set_column(cursor_column);