diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-08 21:45:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-08 21:45:46 +0000 |
commit | b760fe8fafde1d9d9f1f01db57a88cd9ce636342 (patch) | |
tree | ba8196a4f03e7512ca4834739c491fab70731b48 /lib/Lex/Preprocessor.cpp | |
parent | 68822391c14b4c4cd8852a7e320b3a484e5ebbd8 (diff) |
Don't expand tabs when computing the offset from the code-completion column
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 49a25f2574..0c1b858c45 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -221,16 +221,10 @@ bool Preprocessor::SetCodeCompletionPoint(const FileEntry *File, } } - for (unsigned Column = 1; Column < TruncateAtColumn; ++Column, ++Position) { - if (!*Position) - break; - - if (*Position == '\t') - Column += 7; - } + Position += TruncateAtColumn - 1; // Truncate the buffer. - if (Position != Buffer->getBufferEnd()) { + if (Position < Buffer->getBufferEnd()) { MemoryBuffer *TruncatedBuffer = MemoryBuffer::getMemBufferCopy(Buffer->getBufferStart(), Position, Buffer->getBufferIdentifier()); |