Subject: bug#78117: Improve c-ts-mode--c-or-c++-regexp

From: Sergey Abdulov <[email-masked]>
Date: Mon, 28 Apr 2025 11:13:31 +0500

Hello!

I ran into a header that uses C++ features but still opens in c-ts-mode.
Link: https://raw.githubusercontent.com/HandmadeMath/HandmadeMath/refs/heads/master/HandmadeMath.h
Therefore I suggest either:
1) Treat any mention of `__cplusplus` macro as a C++ file
2) Or add an `operatorX` pattern where X is one of the C++ operators
(don't forget <=> etc)

For now I'm enabling c++-ts-mode manually whenever I edit said header
but it's still bad since some of the broken highlighting from
c-ts-mode persists into c++-ts-mode after toggling and gets fixed
after moving the cursor through affected areas. That's another bug
though.

Thanks!