Merge lp://staging/~julien-spautz/scratch/comment-plugin into lp://staging/~elementary-apps/scratch/scratch

Proposed by Julien Spautz
Status: Work in progress
Proposed branch: lp://staging/~julien-spautz/scratch/comment-plugin
Merge into: lp://staging/~elementary-apps/scratch/scratch
Diff against target: 368 lines (+281/-5)
8 files modified
CMakeLists.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)
To merge this branch: bzr merge lp://staging/~julien-spautz/scratch/comment-plugin
Reviewer Review Type Date Requested Status
Mario Guerriero (community) Needs Fixing
Review via email: mp+216878@code.staging.launchpad.net

Description of the change

Implemented a comment/uncomment shortcut as plugin. Not sure what shortcut to use so I'm using Ctrl M and Ctrl Shift M for commenting and uncommenting respectively which I've used in some other editor, don't know which one.

The plugin gets the comment tokens for the current language from gtk.sourceview. It will either comment the current line or the selected text. If only block or only line comments are supported, they are used as a substitute for the other. Un commenting simply removes all comment tokens in the current line or selection, doesn't watch for strings or other exceptions yet.

To post a comment you must log in.
1288. By Julien Spautz

undo deleted line

Revision history for this message
Julien Spautz (julien-spautz) wrote :

Undoing is also kind of fucked up, no idea why.

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

Apart for the bug you mentioned I noticed another little bug. Do the following steps to reproduce:

 - Create a new document
 - Write something
 - Change language highlighting to Vala (or any other language)
 - Try to comment some lines with CTRL+M

It just does not watch for the language_changed signal emitted by the Scratch.Widgets.SourceView class.

Revision history for this message
Mario Guerriero (mefrio-g) :
review: Needs Fixing
1289. By Julien Spautz

watch for language changes

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

I still experience the bug I described above.

Unmerged revisions

1289. By Julien Spautz

watch for language changes

1288. By Julien Spautz

undo deleted line

1287. By Julien Spautz

implemented uncommenting

1286. By Julien Spautz

implemented keyboard shortcut for commenting lines or blocks, uncommenting not yet supported

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches