Commit 5740bf1c authored by Daniel Espinosa Ortiz's avatar Daniel Espinosa Ortiz

didChange: fix handle UTF-8 characters

parent 998cd4c5
Pipeline #131788 passed with stages
in 52 minutes and 43 seconds
......@@ -120,22 +120,39 @@ public interface GVlsp.ServerJsonrpc : Jsonrpc.Server, GVls.Server
int index = 0;
while (l < ls) {
if (str.str.get_next_char (ref index, out c)) {
start++;
start += c.to_string ().length;
if (c == '\n') {
l++;
}
}
}
start += cstart;
int col = 0;
while (col < cstart) {
if (str.str.get_next_char (ref index, out c)) {
start += c.to_string ().length;
col++;
} else {
break;
}
}
while (l < le) {
if (str.str.get_next_char (ref index, out c)) {
offset++;
offset += c.to_string ().length;
if (c == '\n') {
l++;
}
}
}
offset += cend - cstart;
col = 0;
while (col < (cend - cstart)) {
if (str.str.get_next_char (ref index, out c)) {
offset += c.to_string ().length;
col++;
} else {
break;
}
}
str.erase (start, offset);
str.insert (start, text);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment