浏览代码

Fixed highliting with shift and mouse

Paulb23 9 年之前
父节点
当前提交
4cc3fbeaff
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      scene/gui/text_edit.cpp

+ 2 - 5
scene/gui/text_edit.cpp

@@ -644,10 +644,7 @@ void TextEdit::_notification(int p_what) {
 			Point2 cursor_pos;
 
 			// get the highlighted words
-			String highlighted_text;
-			if (is_selection_active()) {
-				highlighted_text = get_selection_text();
-			}
+			String highlighted_text = get_selection_text();
 
 			for (int i=0;i<visible_rows;i++) {
 
@@ -667,7 +664,7 @@ void TextEdit::_notification(int p_what) {
 
 				// check if line contains highlighted word
 				int highlighted_text_col = -1;
-				if (is_selection_active()) {
+				if (highlighted_text.length() != 0) {
 					highlighted_text_col = _get_column_pos_of_word(highlighted_text, str, 0);
 				}