Commit e89b0bb1 authored by Ilia Kats's avatar Ilia Kats
Browse files

latexcompletionplugin: store number of chars, not bytes

parent 01da6e68
Pipeline #80063 passed with stage
in 5 minutes and 59 seconds
......@@ -23,7 +23,7 @@ private Q_SLOTS:
for (int i = 0; i < n_completions - 1; ++i) {
QVERIFY(std::char_traits<char16_t>::compare(completiontable[i].completion,
completiontable[i + 1].completion,
std::min(completiontable[i].completion_strlen, completiontable[i + 1].completion_strlen))
std::max(completiontable[i].completion_strlen, completiontable[i + 1].completion_strlen))
< 0);
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -93,7 +93,9 @@ static constexpr Completion completiontable[] = {{
for letter in completion[2][1:]:
if letter not in wordchars:
completionchars.add(letter)
latexsymlength = len(completion[2].encode("utf-16")) - 2 # Python adds the BOM
latexsymlength = (len(completion[2].encode("utf-16")) - 2) // 2
# Python adds the BOM, thus -2. We need number of charachters, not bytes,
# thus //2
latexsym = completion[2].replace("\\", "\\\\")
if i > 0:
out.write(",")
......
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