Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Qt Creator 13.0.0
-
Kubuntu 22.04
Description
When ClangFormat is enabled, pasted code is incorrectly indented in some instances.
Steps to reproduce:
1. Unpack the attached project.
2. In the unpacked project directory, backup main.cpp by copying it to e.g. main.cpp-orig.
3. Open and configure the project in QtCreator (Boost needs to be installed on the system).
4. Open main.cpp in the editor.
5. Select all (Ctrl+A), cut (Shift+Del) and paste (Shift+Ins).
6. Save the modified main.cpp and compare it with the original main.cpp-orig.
You will notice that the resulting formatting is broken in some instances:
- The list of base classes for my_object and group_iterator are indented to the right, past the colon on the previous line.
- Some comments are indented deeper than before.
- Closing angle brackets in multi-line typedefs and base classes are indented deeper than before.
- Where indentation is modified, it sometimes contain spaces rather than tabs (i.e. the editor attempts to emulate "half-tabs").
Expected behavior:
The pasted code should look exactly like in the original.
Attachments
Issue Links
- duplicates
-
QTCREATORBUG-30304 Indentation is incorrect when pasting copied code
-
- Reported
-