[code] The cursor in a toolbox command does not go before a point.

The cursor now goes either after the first open parenthesis or at the
end of the command.
Fixed z.real and z.imag.

Change-Id: I46ca3be0415832fd91273ca7fed12ed3d6f125dc
This commit is contained in:
Léa Saviot
2017-11-21 10:25:11 +01:00
parent 92789330de
commit f7a6e615ca
4 changed files with 8 additions and 13 deletions

View File

@@ -8,8 +8,6 @@ int CursorIndexInCommand(const char * text) {
for (size_t i = 0; i < strlen(text); i++) {
if (text[i] == '(') {
return i + 1;
} else if (text[i] == '.') {
return i;
}
}
return strlen(text);
@@ -20,10 +18,7 @@ void TextToInsertForCommandMessage(I18n::Message message, char * buffer) {
int currentNewTextIndex = 0;
int numberOfOpenBrackets = 0;
for (size_t i = 0; i < strlen(messageText); i++) {
if (messageText[i] == '.') {
currentNewTextIndex = 0;
numberOfOpenBrackets = 0;
} else if (messageText[i] == ')') {
if (messageText[i] == ')') {
numberOfOpenBrackets--;
}
if (numberOfOpenBrackets == 0 || messageText[i] == ',')