I'm creating my User Define Language in notepad++, and I have a delimiter set like this:

open: try
close: :

But when I type entry, the try gets highlighted, as the delimiter I've set. How can I block that from happening? Any help is welcome.

I'm using windows 8, with notepad++ Je Suis Charlie.

  • Delimiting doesn't seem as good a match for this case as code folding. Can you give some examples of what the try-: pair should look like in context? – Nathan Tuggy Apr 20 '15 at 20:35
  • It's for this use: try code :, and I want code to be highlighted, since I don't want the default color in there. – DCPY Apr 20 '15 at 23:44
  • Hmm. Yeah, I'm not sure N++ can do this easily; if you go and define a full language the way C#, say, is defined you could probably manage it but I don't know how much more work that would be. – Nathan Tuggy Apr 20 '15 at 23:55
  • I saw that creating a UDL in N++ creates a file. So maybe by editing that file directly, with a little bit of research, I would be able to do that so? – DCPY Apr 21 '15 at 1:31
  • You could certainly try that, but the file, and I think even the XML schema, that it uses for UDLs is not the same as for normal languages, and I'm not sure even the format has enough flexibility. – Nathan Tuggy Apr 21 '15 at 1:36

After checking UDL 2.0 online documentation, I do not think it is currently possible. You either use what is offered or write your own highlighter in C++ or switch to editor with more advanced UDL capabilities (e.g. SynWrite) which allows much more control over the highlighter – but, of course, that parser is adequately more difficult to define.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.