r238823 - Make vim also output a helpful message in some error cases.

Manuel Klimek klimek at google.com
Tue Jun 2 05:01:50 PDT 2015


Author: klimek
Date: Tue Jun  2 07:01:50 2015
New Revision: 238823

URL: http://llvm.org/viewvc/llvm-project?rev=238823&view=rev
Log:
Make vim also output a helpful message in some error cases.

When clang-format encounters a syntax error, it will not format that
line; we're now using the same mechanism we're already using in emacs to
show a helpful error message to the user.

Modified:
    cfe/trunk/tools/clang-format/clang-format.py

Modified: cfe/trunk/tools/clang-format/clang-format.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/clang-format.py?rev=238823&r1=238822&r2=238823&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/clang-format.py (original)
+++ cfe/trunk/tools/clang-format/clang-format.py Tue Jun  2 07:01:50 2015
@@ -85,6 +85,8 @@ def main():
     for op in reversed(sequence.get_opcodes()):
       if op[0] is not 'equal':
         vim.current.buffer[op[1]:op[2]] = lines[op[3]:op[4]]
+    if output['IncompleteFormat']:
+      print 'clang-format: incomplete (syntax errors)'
     vim.command('goto %d' % (output['Cursor'] + 1))
 
 main()





More information about the cfe-commits mailing list