Created attachment 147481 [details] ZIP containing two GIFs demonstrating the issue (5.90 vs 5.91) SUMMARY Since the release of ktexteditor 5.91.0, the "toggle comment" feature no longer works on Python code where whitespace is present at the start of the selection. For example, when an empty new line is included above the block, or selecting multiple lines which are indented. Affects KWrite, Kate and KDevelop. Downgrading to 5.90.0 restores the expected behaviour. STEPS TO REPRODUCE 1. In a Python document, select multiple lines which are indented (an example of leading whitespace on a line) 2. Press CTRL+/ to toggle the comment. OBSERVED RESULT Toggling comments only ever comments, and does not uncomment. Please observe the attached zip of GIFs demonstrating this. EXPECTED RESULT The line would be commented and uncommented. ADDITIONAL INFORMATION According to a git bisect, the problematic commit starts at: 690e16d5e06477d5f504d1ab89c760cb0cdcf4ff "Fix comment toggling when all lines in selection aren't commented" https://invent.kde.org/frameworks/ktexteditor/-/commit/690e16d5e06477d5f504d1ab89c760cb0cdcf4ff SOFTWARE/OS VERSIONS OS: Arch Linux KDE Plasma Version: 5.91.0 KDE Frameworks Version: 5.91.0 Qt Version: 5.15.3
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/326
Git commit 1173d5184e8b073790556dbdba92a8b8abdd62dc by Waqar Ahmed. Committed on 14/03/2022 at 04:49. Pushed by cullmann into branch 'master'. Fix toggle comment with space at the start M +48 -0 autotests/src/katedocument_test.cpp M +1 -0 autotests/src/katedocument_test.h M +9 -1 src/document/katedocument.cpp https://invent.kde.org/frameworks/ktexteditor/commit/1173d5184e8b073790556dbdba92a8b8abdd62dc
*** Bug 451764 has been marked as a duplicate of this bug. ***
*** Bug 456534 has been marked as a duplicate of this bug. ***