diff options
author | dim <dim@FreeBSD.org> | 2013-06-10 20:45:12 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-06-10 20:45:12 +0000 |
commit | ea266cad53e3d49771fa38103913d3ec7a166694 (patch) | |
tree | 8f7776b7310bebaf415ac5b69e46e9f928c37144 /tools/clang-format/clang-format.py | |
parent | c72c57c9e9b69944e3e009cd5e209634839581d3 (diff) | |
download | FreeBSD-src-ea266cad53e3d49771fa38103913d3ec7a166694.zip FreeBSD-src-ea266cad53e3d49771fa38103913d3ec7a166694.tar.gz |
Vendor import of clang tags/RELEASE_33/final r183502 (effectively, 3.3
release):
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_33/final@183502
Diffstat (limited to 'tools/clang-format/clang-format.py')
-rw-r--r-- | tools/clang-format/clang-format.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/clang-format/clang-format.py b/tools/clang-format/clang-format.py index de92257..d90c62a 100644 --- a/tools/clang-format/clang-format.py +++ b/tools/clang-format/clang-format.py @@ -23,6 +23,10 @@ import subprocess # Change this to the full path if clang-format is not on the path. binary = 'clang-format' +# Change this to format according to other formatting styles (see +# clang-format -help) +style = 'LLVM' + # Get the current text. buf = vim.current.buffer text = "\n".join(buf) @@ -34,7 +38,8 @@ length = int(vim.eval('line2byte(' + str(vim.current.range.end + 2) + ')')) - offset - 2 # Call formatter. -p = subprocess.Popen([binary, '-offset', str(offset), '-length', str(length)], +p = subprocess.Popen([binary, '-offset', str(offset), '-length', str(length), + '-style', style], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) stdout, stderr = p.communicate(input=text) |