Komentarze - Notepad++

When programming, it is often useful to comment (adding certain tags around or in front of text to mark it is non-code) or uncomment (large) section of text. Notepad++ allows to add two types of comments:

  • block comments, which means adding a special tag in front of each line of (selected) text.
  • stream comments, which means putting special tags around the selected text.

Notepad++ can also remove block comments from text, or toggle them (adding them where absent and removing them where present). These options are available from the Edit menu or the Context Menu (see the section about the Menu kontekstowe for more details).

 

  • To add block comment tags, select Edycja->Comment/Uncomment->Block comment.
  • To remove block comment tags, select Edycja->Comment/Uncomment->Block uncomment.
  • To Toggle tags for all selected lines, select Edycja->Comment/Uncomment->Block toggle comment
  • To add stream comment tags around the selected text, select Edycja->Comment/Uncomment->Stream comment.

Note that if a block comment starts in column 1, and you toggle block comment on a range of lines that contains the line, the line will be uncommented, which is not usually desired. This behaviour is difficult to avoid.