Blame view

build1/epsilon-master/escher/src/text_input_helpers.cpp 411 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  #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;
  }
  
  }