SUMMARY The starting point of comment syntax should be right after the indentation of the commented line. Currently Kate's comment shortcut (Ctrl+/) puts the comment syntax at the very beginning of the line, without regard to the indentation. This bug will cause auto-formatting tools like clang-format to indent the commented line once again. STEPS TO REPRODUCE 1. Example code: main.cc ---- #include <iostream> int main() { std::cout << "Hello World!" << std::endl; { std::cout << "Hello World!" << std::endl; { std::cout << "Hello World!" << std::endl; } } } ---- 2. Press Ctrl+/ to comment the hello-worlds. OBSERVED RESULT Indentations by Ctrl+/ <main.cc> ---- #include <iostream> int main() { // std::cout << "Hello World!" << std::endl; { // std::cout << "Hello World!" << std::endl; { // std::cout << "Hello World!" << std::endl; } } } ---- Result from "clang-format --style=Mozilla main.cc": <main.cc> ---- #include <iostream> int main() { // std::cout << "Hello World!" << std::endl; { // std::cout << "Hello World!" << std::endl; { // std::cout << "Hello World!" << std::endl; } } } ---- EXPECTED RESULT Comments in respect of indentations: <main.cc> ---- #include <iostream> int main() { // std::cout << "Hello World!" << std::endl; { // std::cout << "Hello World!" << std::endl; { // std::cout << "Hello World!" << std::endl; } } } ---- SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora KDE Plasma Version: 5.17.5 KDE Frameworks Version: 5.67.0 Qt Version: 5.13.2 ADDITIONAL INFORMATION None
Confirmed this is still an issue on git master.
*** Bug 429093 has been marked as a duplicate of this bug. ***
Created attachment 155470 [details] Fixed in main I tested this in main and it seems fixed.
This was fixed with KSyntaxHighlighting 656fbbcfd456f07bb7e1fc432cbe4ef6a16e0bcd