jacobslusser / ScintillaNET

A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
MIT License
967 stars 245 forks source link

Brace matching is there, what about tag matching? #359

Closed HitCoder9768 closed 6 years ago

HitCoder9768 commented 7 years ago

so I've written some code which will give me two matching HTML tags, but using the brace matching code for reference, "BraceHighlight(p1,p2)" only works for 2 characters (as expected). I attempted to do something like this

scintilla.BraceHighlight(tagPos1, tagPos2); for(int i = 0; i< tag.Length; i++) { scintilla.BraceHighlight(tagPos1 + i, tagPos2 + 1 + i); }

This only highlights the last character of the tag, which is clearly because each time this method runs, it clears the previous brace highlighting.

Is there any alternative method for this? or would I have to create custom syntax highlighting? I see no easy way around this.

Thanks in advance.

jacobslusser commented 6 years ago

There is no way to use brace matching to highlight entire words at a time -- only braces. You could try using your custom logic with indicators, however, to give you a brace matching like effect.