console: update libgrapheme API to version 2.0.0

libgrapheme recently saw its second major version which was "refactored
for correctness and conformance"[1].

[1]: http://lists.suckless.org/news/2210/0036.html
This commit is contained in:
Cem Keylan 2022-10-08 15:39:05 +02:00 committed by Harry Jeffery
parent 9d224adffe
commit 2de91b2f48

View file

@ -52,7 +52,7 @@ static size_t next_char(char *buffer, size_t position)
return result;
#elif defined(IMV_USE_GRAPHEME)
if (buffer[position] != 0) {
return position + grapheme_next_character_break(buffer + position, SIZE_MAX);
return position + grapheme_next_character_break_utf8(buffer + position, SIZE_MAX);
} else {
return position;
}
@ -85,7 +85,7 @@ static size_t prev_char(char *buffer, size_t position)
size_t result = 0;
size_t step;
do {
step = grapheme_next_character_break(buffer + result, SIZE_MAX);
step = grapheme_next_character_break_utf8(buffer + result, SIZE_MAX);
if (result + step >= position)
break;
result += step;