• Login
Community
  • Login

block comment color

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 4 Posters 328 Views
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.
  • J
    Jim Julian
    last edited by Mar 16, 2025, 4:53 PM

    I find the color of block comment text (orang) on a white background, in python, makes reading difficult.

    I opened the style configurator but could find reference to only single line comment text color (green).

    Is there a way to change the color of python block comment text?

    Thanks.

    A M 2 Replies Last reply Mar 16, 2025, 4:54 PM Reply Quote 0
    • A
      Alan Kilborn @Jim Julian
      last edited by Mar 16, 2025, 4:54 PM

      @Jim-Julian said in block comment color:

      Is there a way to change the color of python block comment text?

      As Python has no “block comment”, only “line comment”…I’m going to give you an answer of “No”.

      J 1 Reply Last reply Mar 16, 2025, 5:05 PM Reply Quote 0
      • J
        Jim Julian @Alan Kilborn
        last edited by Jim Julian Mar 16, 2025, 5:08 PM Mar 16, 2025, 5:05 PM

        @Alan-Kilborn That, I know, and yet, many if not most use single/double quotes to comment blocks of text.

        From Google AI:
        “It’s important to note that using triple-quoted strings as comments is generally discouraged by the
        Python community, especially when the commented code contains triple-quoted strings. The preferred method is to use consecutive single-line comments with #.”

        The column editor makes block commenting a lot easier, however, I just tried that and the text font changed for the commented text.
        How do I change that. The font is too small.

        Also, the combination of orange on white is hard too read but is used with Triple, Triple Double, F Triple, F Triple Double. What are they? I’d like to change those.

        P 1 Reply Last reply Mar 16, 2025, 9:39 PM Reply Quote 0
        • P
          PeterJones @Jim Julian
          last edited by Mar 16, 2025, 9:39 PM

          @Jim-Julian said in block comment color:

          How do I change that. The font is too small.

          The font for COMMENT LINE text is usually the same size and font-face as the Python language as a whole, and if it’s blank, it inherits the size and font-face from Style Configurator > Global Styles > Default Style. By default, the COMMENT LINE size and font-face are left blank, so either you are using a Theme which sets those (some themes foolishly set font faces and font sizes, rather than letting that get properly inherited from a user’s preference) or you changed them yourself at some point.

          Also, the combination of orange on white is hard too read

          Then change it.

          but is used with Triple, Triple Double, F Triple, F Triple Double. What are they? I’d like to change those.

          • TRIPLE = ''' text in triple single quotes'''
          • TRIPLE DOUBLE = """ text in triple double quotes"""
          • F TRIPLE = f'''formatted text with {varname} syntax in triple single quotes'''
          • F TRIPLE DOUBLE = f"""formatted text with {varname} syntax in triple double quotes"""
          J 1 Reply Last reply Mar 16, 2025, 10:22 PM Reply Quote 2
          • J
            Jim Julian @PeterJones
            last edited by Mar 16, 2025, 10:22 PM

            @PeterJones Regarding the font issue: I use default settings to keep things simple. However, yoour suggestion is heard. Thanks for your assistance.

            1 Reply Last reply Reply Quote 0
            • M
              mpheath @Jim Julian
              last edited by Mar 17, 2025, 1:26 AM

              @Jim-Julian said in block comment color:

              I opened the style configurator but could find reference to only single line comment text color (green).

              Is there a way to change the color of python block comment text?

              Thanks.

              @PeterJones mentioned the (orange) triple strings. I’ll mention the (green) block comments.

              The lexer does style block comment text.

              https://github.com/notepad-plus-plus/notepad-plus-plus/blob/a679e8ebfb425ae4c71a34a2080dd1a9a376acd6/lexilla/lexers/LexPython.cxx#L908-L909

              Python has no multiline comment like C like languages unfortunely.

              /*
               comment can span multiple lines
              */
              

              The Python lexer does have block comments if that can be defined as such.

              # comment line
              ## old code
              ## old code
              

              The ## is SCE_P_COMMENTBLOCK style which in Style Configurator described as COMMENT BLOCK. It may not be noticeable as both SCE_P_COMMENTLINE and SCE_P_COMMENTBLOCK default to same style settings.

              Changed COMMENT BLOCK in Style Configurator to grey shows

              pyBlockComment.png

              So now more customization can be done to improve the view.

              1 Reply Last reply Reply Quote 5
              5 out of 6
              • First post
                5/6
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors