Expose "Toggle Comment" feature through tools menu and default shortcut

Authored by slenz on Nov 19 2018, 10:49 AM.



Adds a menu item to toggle comments and adds CTRL + / as a shortcut. Also removes "Comment"/"Uncomment" menu items (but keeps the shortcuts to avoid breaking muscle memory).

BUG: 387654

Test Plan

Test both old and new shortcuts and the new menu item.

Diff Detail

R39 KTextEditor
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
slenz created this revision.Nov 19 2018, 10:49 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptNov 19 2018, 10:49 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
slenz requested review of this revision.Nov 19 2018, 10:49 AM
slenz edited the summary of this revision. (Show Details)Nov 19 2018, 10:53 AM
ngraham requested changes to this revision.Nov 19 2018, 7:15 PM
ngraham added a subscriber: ngraham.

Lovely, this is just what I wanted. It's cool that the feature was already there. :) I like how you preserve the old shortcuts for compatibility. Just a few changes needed from my perspective:


You need to bump the version to 79 or else the changes won't take effect.


Could we also change this string to say "Comment/Uncomment" Rather than "Toggle comment"? I know that's technically correct because this is a toggle action, but generally one doesn't associate "toggling" things with text editing.

This revision now requires changes to proceed.Nov 19 2018, 7:15 PM
slenz updated this revision to Diff 45841.Nov 19 2018, 9:36 PM

Increment menubar file version number

slenz marked an inline comment as done.Nov 19 2018, 9:46 PM
slenz added inline comments.

That might explain why the changes only sometimes appeared. Fixed :)


I think they both make sense, but "Toggle Comment" seems to be the established standard. Three out of my four installed editors used that wording (the last one only used "Comment").

ngraham accepted this revision.Nov 19 2018, 9:50 PM
ngraham added reviewers: Kate, KTextEditor.

Looks good from my perspective! Let's see what the Kate folks think.


OK, let's let the Kate folks have final say then.

This revision is now accepted and ready to land.Nov 19 2018, 9:50 PM
cullmann accepted this revision.Nov 24 2018, 4:36 PM
cullmann added a subscriber: cullmann.

As long as the old shortcuts stay, I think this is ok.

This revision was automatically updated to reflect the committed changes.