From: Manuel Klimek Date: Tue, 2 Jun 2015 12:01:50 +0000 (+0000) Subject: Make vim also output a helpful message in some error cases. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=792a51ffb46f0c5d677ba95683ac585e17e70d5f;p=clang 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 --- diff --git a/tools/clang-format/clang-format.py b/tools/clang-format/clang-format.py index 56a6e5d86b..baa6cdffbe 100644 --- a/tools/clang-format/clang-format.py +++ b/tools/clang-format/clang-format.py @@ -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()