• Login
Community
  • Login

Some types are not highlighted in C header files

Scheduled Pinned Locked Moved General Discussion
13 Posts 4 Posters 1.0k 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
    last edited by Erdos Bolatuly Nov 27, 2022, 6:56 AM Nov 27, 2022, 6:15 AM

    The types int_leastX_t and uint_leastX_t (X - 8, 16, 32, 64) are not highlighted in C header files, although they are defined in the style. Adding these types in the custom part didn’t help.

    Windows 10 x64, Notepad++ v8.4.7 (64-bit).

    Translated with Google Translate.

    E 1 Reply Last reply Nov 27, 2022, 9:09 AM Reply Quote 0
    • E
      Ekopalypse @Erdos Bolatuly
      last edited by Nov 27, 2022, 9:09 AM

      @Erdos-Bolatuly said in Some types are not highlighted in C header files:

      uint_leastX_t

      seems to work for me

      443461b1-0089-4881-aa62-5f0b06eebbb5-image.png

      E 1 Reply Last reply Nov 27, 2022, 9:12 AM Reply Quote 0
      • E
        Erdos Bolatuly @Ekopalypse
        last edited by Nov 27, 2022, 9:12 AM

        @Ekopalypse Read the text again.

        E 1 Reply Last reply Nov 27, 2022, 9:15 AM Reply Quote 0
        • E
          Ekopalypse @Erdos Bolatuly
          last edited by Nov 27, 2022, 9:15 AM

          @Erdos-Bolatuly

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

          E 1 Reply Last reply Nov 27, 2022, 9:27 AM Reply Quote 0
          • E
            Erdos Bolatuly @Ekopalypse
            last edited by Erdos Bolatuly Nov 27, 2022, 9:29 AM Nov 27, 2022, 9:27 AM

            @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?

            E 1 Reply Last reply Nov 27, 2022, 9:34 AM Reply Quote 0
            • E
              Ekopalypse @Erdos Bolatuly
              last edited by Ekopalypse Nov 27, 2022, 9:35 AM Nov 27, 2022, 9:34 AM

              @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 Nov 27, 2022, 9:47 AM Reply Quote 0
              • E
                Erdos Bolatuly @Ekopalypse
                last edited by Nov 27, 2022, 9:47 AM

                @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.

                E 1 Reply Last reply Nov 27, 2022, 9:54 AM Reply Quote 1
                • E
                  Ekopalypse @Erdos Bolatuly
                  last edited by Nov 27, 2022, 9:54 AM

                  @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
                  • E
                    Ekopalypse
                    last edited by Nov 27, 2022, 9:56 AM

                    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 Nov 27, 2022, 10:08 AM Reply Quote 1
                    • E
                      Erdos Bolatuly @Ekopalypse
                      last edited by Nov 27, 2022, 10:08 AM

                      @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!

                      E 1 Reply Last reply Nov 27, 2022, 10:17 AM Reply Quote 0
                      • E
                        Ekopalypse @Erdos Bolatuly
                        last edited by Ekopalypse Nov 27, 2022, 10:20 AM Nov 27, 2022, 10:17 AM

                        @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.

                        M 1 Reply Last reply Aug 8, 2023, 9:53 PM Reply Quote 4
                        • A
                          Alan Kilborn
                          last edited by Nov 27, 2022, 1:34 PM

                          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
                          • M
                            Miug89 @Ekopalypse
                            last edited by Aug 8, 2023, 9:53 PM

                            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