2

I have written my own User Defined Language in Notepad++ and all works fine but I would like to highlight all labels which are defined by all text ending with a colon, e.g.

Label1:
GetCardNumber:

Is there any method of achieving this?

ClickRick
  • 1,553
  • 2
  • 17
  • 37
  • 1
    Maybe try also making lexer in SynWrite editor. Synw has fully controllable lexer properties. (More options then UDL has) – Prog1020 May 02 '14 at 16:40

2 Answers2

1

what you need is not supported by User Defined Languages feature of Notepad++. As commenter already said, you can try for example SynWrite editor if you want to achieve this. Programmers with enough interest can also prepare their own language highlighters for Notepad++ where highlighting of tokens is determined procedurally, what gives virtually unlimited possibilities. (See Notepad++ sources, all built-in languages are done this way.) But UDL's were designed with simplicity in mind, therefore their functionality is limited.

miroxlav
  • 11,796
  • 5
  • 58
  • 99
0

Started using Npp yesterday, ran into same problem. It's clumsy, but you can highlight after the fact by extracting all your labels and pasting them in one of the keyword boxes. In Cygwin or other Linux like environment: sed -n "s/;.*//;s/:.*/:/;/:/p" progfile >labels.txt (my language is an assembler that uses ';' as comment starter, the first command in the sed script removes comments) I don't know what the limit is for number of keywords in Npp, so this may overflow if you have huge number of labels. See picture for example of results. To get this to work while editing, you have to add each label as a keyword as it is typed. Like I said, clumsy, but it works (so far).Comment highlighting Notepad++ UDL (Picture should be called "Label highlighting Notepad++", I was tired when I posted this)