mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] VariableBoxController::autocompletionForText
This commit is contained in:
@@ -187,7 +187,19 @@ void VariableBoxController::loadFunctionsAndVariables() {
|
||||
#endif
|
||||
}
|
||||
|
||||
const char * VariableBoxController::autocompletionForText(const char * text) const {
|
||||
const char * VariableBoxController::autocompletionForText(const char * text) {
|
||||
// TODO LEA Accelerate
|
||||
loadFunctionsAndVariables();
|
||||
const char * endOfText = UTF8Helper::EndOfWord(text);
|
||||
const int textLength = endOfText - text;
|
||||
assert(textLength >= 1);
|
||||
for (int i = 0; i < numberOfRows(); i++) {
|
||||
const char * currentName = scriptNodeAtIndex(i)->name();
|
||||
if (strncmp(text, currentName, textLength) == 0 && *(currentName + textLength)
|
||||
!= 0) {
|
||||
return currentName + textLength;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user