"Toggle Comments" Tool Sometimes indefinitely adds comment symbols in python on each press
** I submitted a bug on the bug forum here as well: https://bugs.kde.org/show_bug.cgi?id=456534
** If this needs to be handled there, feel free to close this issue out. If someone can point me to the actual toggle comments code block where the logic is handled, I'd love to be able to look into this myself
SUMMARY
Testing a python script, I attempted to toggle comments on a few blocks of code, the toggle instead added indefinitely to the existing comment symbol (not automatically, each press adds a new symbol)
STEPS TO REPRODUCE
- Create a basic script, here's an example:
def main():
print("hello world")
if 1 == 1:
print("yes")
print("after")
if \_\_name\_\_ = '\_\_main\_\_':
main()
Looks like the indentation didn't translate well to markdown
- Highlight portions you wish to comment out, hit the toggle comment shortcut (default is ctrl + /), then hit it again, if multiple blocks of code are highlighted, like both the function and the if statement at the bottom, it seems to add more comment characters instead of un-commenting what you just commented (goes for existing comments as well)
OBSERVED RESULT
Additional comment symbols added
EXPECTED RESULT
Toggle between a line being commented and not (adding/removing symbol as needed)
SOFTWARE/OS VERSIONS
Linux: EndeavourOS, Gnome DE (wayland support :/ )
KDE Plasma Version:
KDE Frameworks Version:
Qt Version:
ADDITIONAL INFORMATION
I attempted to find where this code is in gitlab, but couldn't seem to find the lines that were for toggle comment as the only things mentioning "toggle comment" exactly were some .docbook files - so am not able to determine the issue myself. I will happily dive into the code as well if someone can point me to the right spot to look