浏览代码

Make delete_lines work correctly regardless of the selection

ator-dev 3 年之前
父节点
当前提交
3237950216
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/code_editor.cpp

+ 1 - 1
editor/code_editor.cpp

@@ -1314,10 +1314,10 @@ void CodeTextEditor::delete_lines() {
 		int count = Math::abs(to_line - from_line) + 1;
 
 		text_editor->set_caret_line(from_line, false);
+		text_editor->deselect();
 		for (int i = 0; i < count; i++) {
 			_delete_line(from_line);
 		}
-		text_editor->deselect();
 	} else {
 		_delete_line(text_editor->get_caret_line());
 	}