Files
Upsilon/escher/src/text_input_helpers.cpp
Léa Saviot 0294ebc448 [escher] Fix signed/unsigned int comparison
Change-Id: I72b6dc3f46ee585814a540fc999001e113db0ea1
2018-05-16 17:34:34 +02:00

21 lines
411 B
C++

#include <escher/text_input_helpers.h>
#include <ion/charset.h>
#include <string.h>
namespace TextInputHelpers {
size_t CursorIndexInCommand(const char * text) {
size_t index = 0;
while (text[index] != 0) {
if (text[index] == '\'' && text[index+1] == '\'') {
return index + 1;
} else if (text[index] == Ion::Charset::Empty) {
return index;
}
index++;
}
return index;
}
}