https://bugs.kde.org/show_bug.cgi?id=458126

            Bug ID: 458126
           Summary: Toggling comments on selected text that is separated
                    with empty lines, works one way
           Product: kate
           Version: 22.04.1
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: szwend...@proton.me
  Target Milestone: ---

SUMMARY
So the problem is with toggling comment with ctrl+/ shortcut.
If selected text contains empty lines, then this shortcut will only add more
levels of comment (in python adding more # )
, but it will not add comment on the empty line, nor will remove comment if
whole text (except these empty lines) is already commented.

STEPS TO REPRODUCE
1. Create .yml file containing yaml config with empty line:

test:
    test2:
        - whatever

another:
    another2: hello


2. select this whole text with mouse dragging over it
3. press ctrl+/ to comment/uncomment selected text multiple times

OBSERVED RESULT
Additional layers of comment are added to the text:
######test:
    ######test2:
        ######- whatever

######another:
    ######another2: hello

EXPECTED RESULT
Only one level of comment is made, and then removed with every second toggling.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 36
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
If instead of selecting text with mouse dragging, i put on each line
multicursor (leftAlt+click) and then use toogling comments, then it works as
expected.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to