Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize syntax highlighting in n++ for liquid templates #4042

Open
fpierrat opened this issue Jan 3, 2018 · 2 comments
Open

Customize syntax highlighting in n++ for liquid templates #4042

fpierrat opened this issue Jan 3, 2018 · 2 comments
Labels
scintilla dependent Can't be considered for N++ implementation unless/until Scintilla changes

Comments

@fpierrat
Copy link

fpierrat commented Jan 3, 2018

Hi,
I posted on stackoverflow, before I realized it would probably be a good idea to look for a dedicated comunity...

I'd like to customize the syntax highlighting in Notepad++ for liquid templates.
I've seen many and more answers for adding keywords to current keyword-lists, but this doesn't work for what I'm trying.

What i'd like to highlight -> patterns like

  • {{foo}} or {{foo.bar}}
  • {% if foo.bar == 'azerty' %} abcd {% else %} efgh {% endif %}
  • etc...

Actually, I would need to add some kind of "regular" keywords in langs.model.xml, like
\{\{.*?\}\}
or
\{%.*?%\}
But I'm not sure this is possible...

Note: I need this on top of HTML highlighting: symply configuring some custom language in language menu doesn't help, because then I lose all HTML highlighting.

The only place where I saw regex patterns used is in functionList.xml, I had a try there (with no success :-( ) in the PHP section, not finding a HTML section...

Is there a way to achieve this ?

Thanks in advance for your help.

@mnh48
Copy link

mnh48 commented May 30, 2018

I would like to know the way to achieve this too, as I'm heavily using Liquid (+Jekyll) for my static websites' templates and I'm using Notepad++ to write them at the moment.

@ArkadiuszMichalski
Copy link
Contributor

ArkadiuszMichalski commented Oct 1, 2020

@fpierrat @mnh48 You can't use full regex in langs.model.xml (but some not standard rules works, like ^), although I may be wrong. Such requirements you should addressed to https://sourceforge.net/p/scintilla/bugs/ for html lexer, but I doubt they will add support because this lexer is complex/old and templates for HTML are tons.

There was simillar question for Mustache:
https://sourceforge.net/p/scintilla/feature-requests/942/

From comment https://sourceforge.net/p/scintilla/feature-requests/942/#7970:

There are an enormous number of templating languages and they can not all have their own distinct set of lexical states, since Scintilla is limited to 256 states in total.

Before the HTML lexer can grow beyond 7 bit lexical values (128 lexical states) I want someone to come up with a plan on how to make different templating and scripting languages coexist.

Rejected until some progress is made on a plan for this lexer.

@ArkadiuszMichalski ArkadiuszMichalski added the scintilla dependent Can't be considered for N++ implementation unless/until Scintilla changes label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scintilla dependent Can't be considered for N++ implementation unless/until Scintilla changes
Projects
None yet
Development

No branches or pull requests

3 participants