Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
e89b0bb1
Commit
e89b0bb1
authored
Sep 11, 2021
by
Ilia Kats
Browse files
latexcompletionplugin: store number of chars, not bytes
parent
01da6e68
Pipeline
#80063
passed with stage
in 5 minutes and 59 seconds
Changes
3
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
addons/latexunicodecompletion/autotests/testcompletiontable.cpp
View file @
e89b0bb1
...
...
@@ -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
::
m
in
(
completiontable
[
i
].
completion_strlen
,
completiontable
[
i
+
1
].
completion_strlen
))
std
::
m
ax
(
completiontable
[
i
].
completion_strlen
,
completiontable
[
i
+
1
].
completion_strlen
))
<
0
);
}
}
...
...
addons/latexunicodecompletion/completiontable.h
View file @
e89b0bb1
This diff is collapsed.
Click to expand it.
addons/latexunicodecompletion/fetch_unicode_table.py
View file @
e89b0bb1
...
...
@@ -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
(
","
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment