diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2017-05-19 08:55:08 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2017-05-22 13:28:36 +0000 |
commit | 707170ca044b5b2c555798682bf5f3bf5334ecdd (patch) | |
tree | b6c2709617b0593c62eaa98afdc9d3d45cd7d693 /src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp | |
parent | 34702f8441cf890e08cbea91760615c188eac34d (diff) | |
download | qt-creator-707170ca044b5b2c555798682bf5f3bf5334ecdd.tar.gz |
Clang: make workaround for multibyte utf8
Correct columns in clang diagnostics and completion
Task-number: QTCREATORBUG-16775
Change-Id: I7260a0e52007fe261e83492dca5d457c34476497
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp')
-rw-r--r-- | src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp index 631736279d..101aef1a9e 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp @@ -552,7 +552,8 @@ bool ClangCompletionAssistProcessor::sendCompletionRequest(int position, { int line, column; TextEditor::Convenience::convertPosition(m_interface->textDocument(), position, &line, &column); - ++column; + const QTextBlock block = m_interface->textDocument()->findBlock(position); + column += ClangCodeModel::Utils::extraUtf8CharsShift(block.text(), column) + 1; const QString filePath = m_interface->fileName(); |