mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 14:20:39 +01:00
[apps] Never return n after event XNT except in sequence
Change-Id: Ibdd3de34fbba73112f4f1bc15cbac81a19e81a58
This commit is contained in:
@@ -26,23 +26,8 @@ const char * TextFieldDelegateApp::XNT() {
|
||||
}
|
||||
|
||||
bool TextFieldDelegateApp::cursorInToken(TextField * textField, const char * token) {
|
||||
const char * text = textField->text();
|
||||
int location = textField->cursorLocation();
|
||||
int tokenLength = strlen(token);
|
||||
while (location >= 0) {
|
||||
while (text[location] != '(') {
|
||||
location --;
|
||||
}
|
||||
if (location - tokenLength < 0) {
|
||||
return false;
|
||||
}
|
||||
char previousToken[10];
|
||||
strlcpy(previousToken, text+location-tokenLength, tokenLength+1);
|
||||
if (strcmp(previousToken, token) == 0) {
|
||||
return true;
|
||||
}
|
||||
location--;
|
||||
}
|
||||
/* TODO: find a way to return true when cursor is in token(?,,). Warning: be
|
||||
* able to differenciate sum(int(x,1,2),3,4) and sum(2*n,2,3) */
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user