2 colorations syntaxique au sein d'un même fichier, possible ?



  • Bonjour et merci au dev de notepad++ !

    Je me sers régulièrement de cet éditeur pour du code PHP, CSS,JS.

    Est-il possible de configurer notepad++ pour avoir 2 type de colorations syntaxique au sein d’un même ficher ?

    Un exemple tout simple: une page HTML avec une balise <style type=“text/css”>

    La coloration serait active pour tout le HTML
    ET
    active à l’intérieur de la balise <style> pour du CSS


    Hello and thank you to the notepad ++ dev!

    I use this editor regularly for PHP, CSS, JS code.

    Is it possible to configure notepad ++ to have 2 types of syntax highlighting within the same file?

    A simple example: an HTML page with a tag <style type = “text / css”>

    Syntax highlighting would be active for HTML
    AND
    active inside the <style> tag for CSS



  • @amkp-gamy

    I thought this is already the case for html, isn’t it?



  • @Ekopalypse
    What do you mean ?



  • @amkp-gamy
    If one file has CSS and HTML …then the backlight will only work one)



  • @amkp-gamy

    The html lexer is one of the few, if not the only one, lexers which uses multiple lexers
    under the hood. It styles html, js, perl, vbs, python and I assumed it does CSS as well
    but obviously this is not the case. At least with the current used scintilla version but
    I don’t know if a newer scintilla version would have CSS integrated into html lexer.

    Sorry, but I don’t think that there is a way to make two builtin lexers working at the same time. What one could try is to use a technique like described here but to be honest I haven’t much experience in css to understand its basic layout meaning. If you want to discuss this further let me know - will be online gain in about 7-8 hours.


Log in to reply