Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 792a51f

Browse files
committed
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238823 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 79e3e87 commit 792a51f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/clang-format/clang-format.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def main():
8585
for op in reversed(sequence.get_opcodes()):
8686
if op[0] is not 'equal':
8787
vim.current.buffer[op[1]:op[2]] = lines[op[3]:op[4]]
88+
if output['IncompleteFormat']:
89+
print 'clang-format: incomplete (syntax errors)'
8890
vim.command('goto %d' % (output['Cursor'] + 1))
8991

9092
main()

0 commit comments

Comments
 (0)