hotkey for comment/uncomment lines/blocks
Bug #1251365 reported by
swizzle
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Scratch |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
PhpStorm has the hotkey Ctrl + / which comments the current line or the selected block.
Of course every language has its own comment system but Scratch should be smart enough to put the right comment symbols
around the line/block.
PS: For commenting a line the cursor just needs to be in the current line itself. The line doesn't have to be selected.
Related branches
lp://staging/~julien-spautz/scratch/comment-plugin
On hold
for merging
into
lp://staging/~elementary-apps/scratch/scratch
- Mario Guerriero (community): Needs Fixing
-
Diff: 368 lines (+281/-5)8 files modifiedCMakeLists.txt (+1/-1)
plugins/CMakeLists.txt (+1/-0)
plugins/comment/CMakeLists.txt (+24/-0)
plugins/comment/CommentPlugin.vala (+65/-0)
plugins/comment/Commentator.vala (+175/-0)
plugins/comment/comment.plugin (+10/-0)
plugins/vim-emulation/vim-emulation.vala (+1/-1)
src/Widgets/SourceView.vala (+4/-3)
Changed in scratch: | |
milestone: | none → 2.1 |
status: | New → Confirmed |
importance: | Undecided → Wishlist |
tags: | added: plugin |
Changed in scratch: | |
milestone: | isis-beta1 → feature-future |
Changed in scratch: | |
assignee: | nobody → Julien Spautz (julien-spautz) |
Changed in scratch: | |
status: | Confirmed → In Progress |
Changed in scratch: | |
status: | In Progress → Confirmed |
assignee: | Julien Spautz (julien-spautz) → nobody |
To post a comment you must log in.
Little hint: gtksourceview knows what tokens the language uses for line and block comments, if the .lang file specifies this, ofc.
See: <metadata> on https:/ /developer. gnome.org/ gtksourceview/ unstable/ lang-reference. html valadoc. org/#!api= gtksourceview- 3.0/Gtk. SourceLanguage. get_metadata
and http://
Haven't tried this, but it should work somewhat like this:
var line_comment_start = source_ language. get_metadata ("line- comment- start") ; // block-comment- start, block-comment-end
for C this would return "//", "/*", "*/" respectively.