Bug 387654 - Comment command should be smart enough to uncomment, too
Summary: Comment command should be smart enough to uncomment, too
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: 17.08.2
Platform: Neon Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2017-12-06 20:08 UTC by Nate Graham
Modified: 2018-11-24 16:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 19.04.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2017-12-06 20:08:58 UTC
If you use the "Comment" command, it will comment out the current line or the selection, But if you invoke it again (i.e. from the keyboard shortcut), it will uselessly add another level of commenting. It should be smart enough to uncomment as well, so you don't need to use a separate menu item and keyboard shortcut for uncommenting.
Comment 1 Silas Lenz 2018-11-13 19:11:48 UTC
Seems like this is already implemented but only accessible via custom keyboard shortcuts or adding it to the toolbar. (For some reason there are two "Toggle comment" alternatives and only one works.)

I guess the right course of action is to remove "Comment"/"Uncomment" from the menu and replace them with a "Toggle comment", and also remove the default shortcuts for those and set CRTL+D to "Toggle comment"? Or maybe a better solution is to keep them and add CRTL+'/', since that is the default in "every other editor"?
Comment 2 Christoph Cullmann 2018-11-24 16:37:19 UTC
Git commit c7095834d282b57e66c8256ef94f4e8c14032b3c by Christoph Cullmann, on behalf of Silas Lenz.
Committed on 24/11/2018 at 16:37.
Pushed by cullmann into branch 'master'.

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

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).

{F6432040}

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

Reviewers: #vdg, ngraham, #kate, #ktexteditor, cullmann

Reviewed By: #vdg, ngraham, #kate, #ktexteditor, cullmann

Subscribers: cullmann, ngraham, kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D17008

M  +2    -3    src/data/katepart5ui.rc
M  +1    -0    src/view/kateview.cpp

https://commits.kde.org/ktexteditor/c7095834d282b57e66c8256ef94f4e8c14032b3c