llvm-project
llvm-project copied to clipboard
clang-format -lines modifies code outside the specified range
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
@llvm/issue-subscribers-clang-format
Author: entity (just-some-entity)
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