Community
    • Login

    Some types are not highlighted in C header files

    Scheduled Pinned Locked Moved General Discussion
    13 Posts 4 Posters 890 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.
    • E
      Erdos Bolatuly @Ekopalypse
      last edited by

      @Ekopalypse Read the text again.

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Erdos Bolatuly
        last edited by

        @Erdos-Bolatuly

        I don’t get it, which part am I missing??

        E 1 Reply Last reply Reply Quote 0
        • E
          Erdos Bolatuly @Ekopalypse
          last edited by Erdos Bolatuly

          @Ekopalypse I meant int_least8_t, uint_least8_t, int_least16_t, uint_least16_t, etc., not int_leastX_t and uint_leastX_t (where X is the size). These types are highlighted in *.c sources, but not in *.h header files. Even adding these definitions to user style manually doesn’t help. Now it is clear?

          EkopalypseE 1 Reply Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse @Erdos Bolatuly
            last edited by Ekopalypse

            @Erdos-Bolatuly

            it doesn’t matter if it is 8, 16 … whatever size.
            It might be that your header files are assigned to cpp and you need to add it there. Could this be??

            ca905524-aba8-43ed-81d2-694f20089df2-image.png

            E 1 Reply Last reply Reply Quote 0
            • E
              Erdos Bolatuly @Ekopalypse
              last edited by

              @Ekopalypse These are C++ styles.

              The type defined in the style is not highlighted in *.h header files:
              Notepad++_bug_001.png

              I hope you understand me.

              EkopalypseE 1 Reply Last reply Reply Quote 1
              • EkopalypseE
                Ekopalypse @Erdos Bolatuly
                last edited by

                @Erdos-Bolatuly

                Yes, that is what I am trying to say. You need to either remove the cpp lexer and assign the .h extension to the c lexer or, if the cpp lexer is also used, add it to it.
                By default, header files are opened with the cpp lexer.
                In reality it’s the same code under the hood anyway, but for configuration it’s either way.

                1 Reply Last reply Reply Quote 2
                • EkopalypseE
                  Ekopalypse
                  last edited by

                  In your screenshot you see, that only c and lex extensions are configured for the c language.

                  9722e67e-9279-4347-92f3-5ca32092f3d8-image.png

                  E 1 Reply Last reply Reply Quote 1
                  • E
                    Erdos Bolatuly @Ekopalypse
                    last edited by

                    @Ekopalypse Something the default settings are illogical. Adding “h” to “User ext.” C language didn’t help. Only adding these types to “User-defined keywords” to C++ style helped. But this is not what I was looking for. Thanks for the help!

                    EkopalypseE 1 Reply Last reply Reply Quote 0
                    • EkopalypseE
                      Ekopalypse @Erdos Bolatuly
                      last edited by Ekopalypse

                      @Erdos-Bolatuly

                      Npp recognizes which Lexer configuration to load by the file extension. If you want .h files to be configured via C configuration, you must add them to C and remove them from cpp. Depending on whether you are using the default theme or not, you will need to edit stylers.xml or THEME_NAME.xml to make this happen.
                      And edit these files with a program other than npp, as it may overwrite them on exit.

                      Miug89M 1 Reply Last reply Reply Quote 4
                      • Alan KilbornA
                        Alan Kilborn
                        last edited by

                        At the very least (sorry), these keywords are missing from the C++ default keyword list, and should be added:

                        • int_least8_t
                        • int_least16_t
                        • int_least32_t
                        • int_least64_t

                        I suppose whether you like your header (.h) files to be considered “C” or “C++” is a matter of individual choice, so I don’t think there’s anything more to do other than what @Ekopalypse has already indicated.

                        1 Reply Last reply Reply Quote 4
                        • Miug89M
                          Miug89 @Ekopalypse
                          last edited by

                          This post is deleted!
                          1 Reply Last reply Reply Quote -1
                          • First post
                            Last post
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors