forked from OSchip/llvm-project
Don't expand tabs when computing the offset from the code-completion column
llvm-svn: 90881
This commit is contained in:
parent
e74042a8e3
commit
9291ab6d80
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue