Skip to content

Commit

Permalink
Merge pull request #594 from RoaringFerrum/master
Browse files Browse the repository at this point in the history
fix completion failure on utf-8 multi-byte characters.
  • Loading branch information
xaizek authored Nov 30, 2022
2 parents e25b6a5 + 74ec230 commit d866f31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/clang/cindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ def from_source(cls, filename, args=None, unsaved_files=None, options=0,

unsaved_array[i].name = encode(name)
unsaved_array[i].contents = encode(contents)
unsaved_array[i].length = len(contents)
unsaved_array[i].length = len(unsaved_array[i].contents)

ptr = conf.lib.clang_parseTranslationUnit(index, encode(filename),
args_array, len(args), unsaved_array,
Expand Down Expand Up @@ -2207,7 +2207,7 @@ def reparse(self, unsaved_files=None, options=0):
raise TypeError('Unexpected unsaved file contents.')
unsaved_files_array[i].name = encode(name)
unsaved_files_array[i].contents = encode(value)
unsaved_files_array[i].length = len(value)
unsaved_files_array[i].length = len(unsaved_files_array[i].contents)
ptr = conf.lib.clang_reparseTranslationUnit(self, len(unsaved_files),
unsaved_files_array, options)

Expand Down Expand Up @@ -2271,7 +2271,7 @@ def codeComplete(self, path, line, column, unsaved_files=None,
raise TypeError('Unexpected unsaved file contents.')
unsaved_files_array[i].name = encode(name)
unsaved_files_array[i].contents = encode(value)
unsaved_files_array[i].length = len(value)
unsaved_files_array[i].length = len(unsaved_files_array[i].contents)
ptr = conf.lib.clang_codeCompleteAt(self, encode(path), line, column,
unsaved_files_array, len(unsaved_files), options)
if ptr:
Expand Down

0 comments on commit d866f31

Please sign in to comment.