Code Comment

The purpose of the Code Comment plugin is to disable or re-enable a portion of code. It inserts or removes the characters used for comments, depending on the language or syntax of the file.

First select some lines of code (or lines of text), then trigger the desired action (comment or uncomment) via one of these methods:

  • With the right-click menu in the main text area.

  • With keyboard shortcuts: Ctrl+M for the comment action, and Ctrl+Shift+M for the uncomment action.

Troubleshooting

If it doesn't work:

  • Make sure that the plugin is enabled by going to the Preferences dialog.

  • Check that the highlight mode (the syntax) for the document is correctly set and is not “Plain Text”. For plain text documents, the code comment plugin doesn't know what characters to insert or remove.

  • If it still doesn't work as intended, a more advanced technique is to look at the language definition files. From these files, the code comment plugin uses the line-comment-start, block-comment-start and block-comment-end metadata.