r182386 - Fix behavior of clang-format's -cursor flag.
Daniel Jasper
djasper at google.com
Tue May 21 07:21:46 PDT 2013
Author: djasper
Date: Tue May 21 09:21:46 2013
New Revision: 182386
URL: http://llvm.org/viewvc/llvm-project?rev=182386&view=rev
Log:
Fix behavior of clang-format's -cursor flag.
Modified:
cfe/trunk/tools/clang-format/ClangFormat.cpp
Modified: cfe/trunk/tools/clang-format/ClangFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ClangFormat.cpp?rev=182386&r1=182385&r2=182386&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/ClangFormat.cpp (original)
+++ cfe/trunk/tools/clang-format/ClangFormat.cpp Tue May 21 09:21:46 2013
@@ -226,7 +226,7 @@ static bool format(std::string FileName)
Rewrite.getEditBuffer(ID).write(FileStream);
FileStream.flush();
} else {
- if (Cursor != 0)
+ if (Cursor.getNumOccurrences() != 0)
outs() << "{ \"Cursor\": " << tooling::shiftedCodePosition(
Replaces, Cursor) << " }\n";
Rewrite.getEditBuffer(ID).write(outs());
More information about the cfe-commits
mailing list