clang-format -lines modifies code outside the specified range
Open
clang-format
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
When using an editor with “format on paste” enabled via clang-format, pasting an incomplete line, like in the example below, causes the following line to be indented, even if -lines is set to target only the pasted line. Pasting a partial line while using format-on-paste to adjust its indentation is a fairly reasonable workflow in my opinion, so it would be nice to either "fix" this behaviour or add a clang-format option to disable it.
```
QWindow* // pasted line
class RhiResourceManager
```
Contributor guide
Assessment
This issue has not been assessed yet.