Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to add background highlighting for comments.

    Help wanted · · · – – – · · ·
    3
    7
    1383
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SalviaSage
      SalviaSage last edited by

      In one of my custom syntax highlighter files for a specific language, I saw that it is highlighting the background of comments as gray.

      So, I thought maybe this can be done by some way by interacting with the Scintilla API through external code for comments in any language.

      So basically, if n++ thinks its a comment, not only is its text highlighted but also its background is highlighted as well.

      Does anyone know if this can be done and how?

      Ekopalypse 2 Replies Last reply Reply Quote 0
      • Ekopalypse
        Ekopalypse @SalviaSage last edited by Ekopalypse

        @SalviaSage

        I get, that you do not want to change the comment style using the style configuration dialog, right?

        Via external code, it isn’t easy as well as the comment style isn’t the same always.
        For example, in python the comment style id is 1, in perl 2 and in php 124.
        In addition, there might be more than one style id defined for comments.
        And last but not least, if have read the stylers/themes.xml and you know all comment style ids,
        you start fighting with the internal lexer about who sets the background color.

        All in all, this doesn’t sound practical.

        1 Reply Last reply Reply Quote 1
        • Ekopalypse
          Ekopalypse @SalviaSage last edited by

          @SalviaSage

          what you MAYBE could do is

          • get the bufferactivated notification
          • check which lexer is set
          • read from xml which comment styleid(s) are used
          • reset the background color for this styleid

          but I ASSUME that this needs to be done always, meaning on each
          bufferactivated notification.

          1 Reply Last reply Reply Quote 1
          • Prahlad-Makwana4145
            Prahlad-Makwana4145 last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • Prahlad-Makwana4145
              Prahlad-Makwana4145 last edited by

              Hello, @SalviaSage

              Follow these steps to add background highlighting for comments.

              step 1:- Select the comment line/word to highlight.
              step 2:- Go to Search Menu
              step 3:- Select Mark All.
              step 4:- you will find 5 sub-menu as 1st to 5th style.

              Note :-

              • Using first style : cyan color.
              • Using second style : light brown.
              • Using third style: yellow.
              • Using fourth style: purple.
              • Using fifth style: green.

              I hope above information will be useful for you.
              Thank you.

              1 Reply Last reply Reply Quote 0
              • SalviaSage
                SalviaSage last edited by

                I get, that you do not want to change the comment style using the style configuration dialog, right?
                Actually, I would change it from there but I don’t see anything that has to do with the comments in that list.

                There is a bunch of other stuff but no comments, so maybe I am missing something?

                1 Reply Last reply Reply Quote 0
                • SalviaSage
                  SalviaSage last edited by

                  Actually, I just found where this can be set in the style configurator.

                  It is not in global styles, so you have to change the background color for each language that is on that list.

                  Solved.

                  1 Reply Last reply Reply Quote 3
                  • First post
                    Last post
                  Copyright © 2014 NodeBB Forums | Contributors