SUMMARY when commenting a line, '//' is added at the start of the line (column 0) when cutting and pasting the commented line, it's indented to match the current code, with '//' in column !=0 STEPS TO REPRODUCE 0. work with indentation if (some_condition) something to comment 1. comment an indented line if (some_condition) // something to comment 2. cut that line 3. paste that line OBSERVED RESULT if (some_condition) // something to comment EXPECTED RESULT if (some_condition) // something to comment SOFTWARE/OS VERSIONS Windows: MacOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Cannot reproduce this on latest released packages (Arch linux, Frameworks 5.58.0, Qt 5.12.3, KWrite 19.04.1). Updating version to indicate this. Start with following code (in empty CPP file): (. = space, | = cursor, tested with and without vi input mode.) if (some_condition) ....something_to_comment();| Use Ctrl+/ to toggle comment line (this seems to append //. in front). if (some_condition) //.....something_to_comment();| Highlight entire line and cut. if (some_condition) | And paste. if (some_condition) //.....something_to_comment(); The bug appears to be resolved in the latest released version. Marking bug as resolved/fixed and closing.