浏览代码

Stop completion when the match is perfect

to avoid the completion insisting showing up after a completion.
George Marques 9 年之前
父节点
当前提交
ec18b97f5c
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      scene/gui/text_edit.cpp

+ 5 - 0
scene/gui/text_edit.cpp

@@ -4140,6 +4140,11 @@ void TextEdit::_update_completion_candidates() {
 	int ci_match=0;
 	Vector<float> sim_cache;
 	for(int i=0;i<completion_strings.size();i++) {
+		if (s == completion_strings[i]) {
+			// A perfect match, stop completion
+			_cancel_completion();
+			return;
+		}
 		if (s.is_subsequence_ofi(completion_strings[i])) {
 			// don't remove duplicates if no input is provided
 			if (s != "" && completion_options.find(completion_strings[i]) != -1) {