From d4304e93d08f004588a90f72de04a7fdebc75022 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Tue, 17 Nov 2020 11:48:32 +0100 Subject: [PATCH] vim: fix clang-format script --- .vim/syntax/clang-format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vim/syntax/clang-format.py b/.vim/syntax/clang-format.py index b61c771..a1f0124 100755 --- a/.vim/syntax/clang-format.py +++ b/.vim/syntax/clang-format.py @@ -44,7 +44,6 @@ if vim.eval('exists("g:clang_format_path")') == "1": # 'clang-format --help' for a list of supported styles. The default looks for # a '.clang-format' or '_clang-format' file to indicate the style that should be # used. -style = 'file' fallback_style = None if vim.eval('exists("g:clang_format_fallback_style")') == "1": fallback_style = vim.eval('g:clang_format_fallback_style') @@ -55,6 +54,7 @@ def get_buffer(encoding): return [ line.decode(encoding) for line in vim.current.buffer ] def main(): + style = 'file' # Get the current text. encoding = vim.eval("&encoding") buf = get_buffer(encoding) @@ -121,7 +121,7 @@ def main(): lines = lines[1:] sequence = difflib.SequenceMatcher(None, buf, lines) for op in reversed(sequence.get_opcodes()): - if op[0] is not 'equal': + if op[0] != 'equal': vim.current.buffer[op[1]:op[2]] = lines[op[3]:op[4]] if output.get('IncompleteFormat'): print('clang-format: incomplete (syntax errors)')