aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2017-01-08 03:01:52 -0300
committerJuan Linietsky2017-01-08 03:01:52 -0300
commit8963ca3d17ff6e1340cb5c2eb88a6485ec422a64 (patch)
tree9154c469e1f0a33dc34ae0f4ed49b36b49cfdbf9 /scene/gui/text_edit.cpp
parent8b912d11152410302f45eaa117c19b7016d781f5 (diff)
downloadgodot-8963ca3d17ff6e1340cb5c2eb88a6485ec422a64.tar.gz
godot-8963ca3d17ff6e1340cb5c2eb88a6485ec422a64.tar.zst
godot-8963ca3d17ff6e1340cb5c2eb88a6485ec422a64.zip
Fix code completion for new getnode syntax
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 4ea44a6ea..c2f644207 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4230,7 +4230,6 @@ void TextEdit::_update_completion_candidates() {
String l = text[cursor.line];
int cofs = CLAMP(cursor.column,0,l.length());
-
String s;
//look for keywords first
@@ -4279,14 +4278,14 @@ void TextEdit::_update_completion_candidates() {
while(cofs>0 && l[cofs-1]>32 && _is_completable(l[cofs-1])) {
s=String::chr(l[cofs-1])+s;
- if (l[cofs-1]=='\'' || l[cofs-1]=='"')
+ if (l[cofs-1]=='\'' || l[cofs-1]=='"' || l[cofs-1]=='$')
break;
cofs--;
}
}
- if (cursor.column > 0 && l[cursor.column - 1] == '(' && !pre_keyword && !completion_strings[0].begins_with("\"")) {
+ if (cursor.column > 0 && l[cursor.column - 1] == '(' && !pre_keyword && !completion_strings[0].begins_with("\"")) {
cancel = true;
}
@@ -4308,8 +4307,9 @@ void TextEdit::_update_completion_candidates() {
_cancel_completion();
return;
}
+
if (s.is_subsequence_ofi(completion_strings[i])) {
- // don't remove duplicates if no input is provided
+ // don't remove duplicates if no input is provided
if (s != "" && completion_options.find(completion_strings[i]) != -1) {
continue;
}
@@ -4345,6 +4345,7 @@ void TextEdit::_update_completion_candidates() {
if (completion_options.size()==0) {
//no options to complete, cancel
_cancel_completion();
+
return;
}