0

For example, I wanted to be able to collapse this section block.

/* BEGIN FOOTER CSS */

footer {
    padding: 40px 0px 30px 0px !important;
}

div.copyright {
    padding: 60px 0px 0px 0px !important;
}

/* END FOOTER CSS */

How can I do this?

Doug
  • 305
  • 3
  • 5
  • 18

2 Answers2

0

as soon as you change the language to css, you get the collapsing option displayed (at least in v. 6.1.5)...

Resu
  • 1
  • 1
  • I can collapse comments, but not blocks. – Doug Mar 26 '14 at 19:31
  • ah, sorry, misunderstood your question: in that case what about this: http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Languages there you can define any "marker" as beginning and/or end of a block (in your case your comment...) – Resu Mar 27 '14 at 07:26
0

You can do what you are trying to by defining a user defined language.

Go to Language -> Define your language.

Under the 'Folding in code 1 style' open list, in the 'Open' box, insert: ///* BEGIN and in the 'Close' box insert ///* END.

The reason for the triple forward slashes is that they are escape characters to prevent NP++ from viewing the /* as a regex match (i think - figured that out by experimentation).

See also.

fzzylogic
  • 103
  • 3
  • Won't the ///* cause problems later for the CSS parser? – Doug May 21 '14 at 03:23
  • No. The actual comments in the CSS will be normal comments. i.e. /* comment */ . The instructions and syntax above apply to settings within NP++, to tell it how to identify normal CSS comments. – fzzylogic May 23 '14 at 09:56
  • Just to qualify that, "...normal CSS comments..." of the type that you're aiming to use. Where two separate comments will define the beginning and end of a foldable block. So it will only work work with your suggested BEGIN / END syntax. – fzzylogic May 23 '14 at 15:05