<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Clang-Format script for vim fails if a line range is given"
href="https://bugs.llvm.org/show_bug.cgi?id=35368">35368</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang-Format script for vim fails if a line range is given
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Formatter
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>eyenseo@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Basically the following is executed from "<path-to-this-file>/clang-format.py"
if you define l:lines=59:72 before calling:
['clang-format', '-style', 'file', '-cursor', '1658', '6', '9', ':', '7', '2',
'-assume-filename', '/tmp/foo.cpp']
but the correct command would be
['clang-format', '-style', 'file', '-cursor', '1658', '-lines', '68:72',
'-assume-filename', '/tmp/foo.cpp']
Line 96 with "command += lines" is the culprit and has to be
"command.extend(["-lines", lines])"
It would be nice if someone can make a commit from this - I have had a look at
the "Getting involved" pages but have no experience with svn / svn patch
generation and am not willing to invest a lot of time for this one liner. For
the next time - would it be better to send a message like this to one of the
mailing lists or did I do the 'right' thing in opening a bug?
Thank you for your hard work! :)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>