Procházet zdrojové kódy

Fix crash during completion lookback

daniel-mcclintock před 4 roky
rodič
revize
8a8c172b93
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      scene/gui/code_edit.cpp

+ 1 - 1
scene/gui/code_edit.cpp

@@ -2744,7 +2744,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() {
 		/* If we have a space, previous word might be a keyword. eg "func |". */
 		/* If we have a space, previous word might be a keyword. eg "func |". */
 	} else if (cofs > 0 && line[cofs - 1] == ' ') {
 	} else if (cofs > 0 && line[cofs - 1] == ' ') {
 		int ofs = cofs - 1;
 		int ofs = cofs - 1;
-		while (ofs >= 0 && line[ofs] == ' ') {
+		while (ofs > 0 && line[ofs] == ' ') {
 			ofs--;
 			ofs--;
 		}
 		}
 		prev_is_word = _is_char(line[ofs]);
 		prev_is_word = _is_char(line[ofs]);