The problem is that `.h` is an extension used for multiple filetypes in the 
real world and I have my personal feelings about this [expletive deleted] 
insanity, thats what `.hpp` is for, but anyway the world is what it is and `.h` 
is used for C, C++ and others.

Because C++ is a superset of C, and C++ has rather more in the "header" files 
than C does usually, C++ headers need to be C++, they rarely highlight or parse 
well if treated as C.  But C ones will still pretty much parse and highlight 
correctly if treated as C++.   So it was decided that making the setting for 
`.h` C++ will be mostly ok for C contents too.  So the default setting in 
`filetype_extensions.conf` put `*.h` on C++.  And because C++ is before any 
other filetype that also uses `*.h` the C++ setting overrides those settings 
which are after it.

And since Geany has a mix of C and C++ with both using `.h` for header, then of 
course the default settings must suit Geany :stuck_out_tongue_winking_eye:.

Your options for using `.h` are:

1. if you only use C but no C++ then in `filetype_extensions.conf` add `.h` to C
2. add your snipets to both C and C++
3. add `// -*- C -*-` to your C headers so they are explicit independent of the 
extension

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3992#issuecomment-2408548537
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/3992/[email protected]>

Reply via email to