Don't expand tabs when computing the offset from the code-completion column

llvm-svn: 90881
This commit is contained in:
Douglas Gregor 2009-12-08 21:45:46 +00:00
parent e74042a8e3
commit 9291ab6d80
1 changed files with 2 additions and 8 deletions

View File

@ -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());