HTML/JSP/XML Un/Comment - plugin detail

Provides comment-out toggle action for HTML files, JSP files and XML files.

NetBeans Plugin - HTML/JSP/XML Un/Comment
Plugin owner: geertjan
Added: 2008-05-22
License: CDDL
Downloaded: 5,358 times
 4.38, by 1 users

Plugin Log Show log

Versions available

Download plugin   Download size: 0.01 MB   Last Update: 2008-05-23

What's new in this version

0.8 fixes the Undo problem. 0.9 fixes the multiline comment problem.

Verifications for NetBeans versions

Plugin is not subject to any verification


In a HTML file, JSP file, or XML file:

  • Select multiple lines or select nothing. If nothing is selected, only the current line is affected.
  • Right-click and choose 'Toggle Comment', or press Ctrl-Shift-C, or press Ctrl-/ (from 0.7 onwards), or click the Toggle Comment button in the editor's toolbar.





Unresolved problems:

  • Fixed in 0.9: When you have commented out a multiline selection and you then choose to remove the comments for a single line within the multiline selection, the plugin doesn't know about the selection and therefore assumes that the current line is not commented out, so it comments out the current line, which messes up the block's comment-out. The proper way to handle this is for the plugin to comment out multiline selections line by line, rather than as a block. However, currently the plugin doesn't do this. The workaround is simple: if you want to remove the comments around the block, select the whole block, instead of a single line, and then invoke the action, at which point the comments will be removed.
  • The Java editor has two buttons in the toolbar, one for commenting out and one for reverting to the normal state. However, this plugin only provides one button in the toolbar, which toggles the comment/comment out action.
  • Fixed in 0.8: If you undo a commented out line or selection, via the Undo action, you need to go back a few buffers. Don't worry (and don't panic) if one undo results in your text disappearing, just do another undo and it will be back in its original state. This will be fixed soon.
  • The Source | Toggle Comment menu item is greyed out for these editors, even though the action is now supported. The menu item needs to be activated somehow by the plugin, need to investigate this.
  • Currently the plugin assumes that each line ends with a linebreak. If, for example, the final line of the document does not end in a linebreak, removing the comment tags in the final line will fail because the plugin will assume the line hasn't been commented because the line doesn't end in a linebreak. Therefore, it will add comment tags even though the line already has comment tags. However, you're not very likely to have commented out the final line in the first place, so this should not be a significant problem.

Here's the button that the plugin makes available to the toolbar of the HTML editor, the XML editor, and the JSP editor:


[ You have to be logged in to be able to comment. ]

User Comments


Problems downloading

Hey, I really want to use your plugin but I get an error when I try to download it.

Posted by devinwhalen on Sep 17, 2009
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo