Some types are not highlighted in C header files
-
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.
-
@Erdos-Bolatuly said in Some types are not highlighted in C header files:
uint_leastX_t
seems to work for me
-
@Ekopalypse Read the text again.
-
I don’t get it, which part am I missing??
-
@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?
-
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?? -
@Ekopalypse These are C++ styles.
The type defined in the style is not highlighted in *.h header files:
I hope you understand me.
-
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. -
In your screenshot you see, that only c and lex extensions are configured for the c language.
-
@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!
-
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. -
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. -
This post is deleted!