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

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

Details

Summary

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

Repository
R39 KTextEditor
Branch
arcpatch-D17008_1
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5155
Build 5173: arc lint + arc unit
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:

src/data/katepart5ui.rc
2

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

src/view/kateview.cpp
543–544

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.
src/data/katepart5ui.rc
2

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

src/view/kateview.cpp
543–544

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.

src/view/kateview.cpp
543–544

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.