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) { Position += TruncateAtColumn - 1;
if (!*Position)
break;
if (*Position == '\t')
Column += 7;
}
// Truncate the buffer. // Truncate the buffer.
if (Position != Buffer->getBufferEnd()) { if (Position < Buffer->getBufferEnd()) {
MemoryBuffer *TruncatedBuffer MemoryBuffer *TruncatedBuffer
= MemoryBuffer::getMemBufferCopy(Buffer->getBufferStart(), Position, = MemoryBuffer::getMemBufferCopy(Buffer->getBufferStart(), Position,
Buffer->getBufferIdentifier()); Buffer->getBufferIdentifier());