]> granicus.if.org Git - clang/commit
clang-format: Add capability to format the diff on save in vim.
authorDaniel Jasper <djasper@google.com>
Mon, 19 Jun 2017 07:30:04 +0000 (07:30 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 19 Jun 2017 07:30:04 +0000 (07:30 +0000)
commit115052359dace05d2fe72edfeaf609623aff4f0e
tree78f0ce0da10ef2a7436f211aa1ed0c1a63ed9781
parent52b6305306e3d9127124d1cf6976d1a3a3c79e86
clang-format: Add capability to format the diff on save in vim.

With this patch, one can configure a BufWrite hook that will make the
clang-format integration compute a diff of the current buffer with the file
that's on disk and format all changed lines. This should create a
zero-overhead auto-format solution that doesn't require the file to
already be clang-format clean to avoid spurious diffs.

Review: https://reviews.llvm.org/D32429

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305665 91177308-0d34-0410-b5e6-96231b3b80d8
docs/ClangFormat.rst
tools/clang-format/clang-format.py