commit 2698a2ba687cb5f5bc49aa6011b6dee9c35a5f39
parent ff0e01a69e6e21579c8d84906f9dfc0dc144e08e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 6 Oct 2019 11:29:48 +0200
syntax: c: recognize some C++ header files by their Emacs modeline
For extensionless files, recognize C/C++ ones from the mode name
between the -*- marks on the first line.
This addresses https://savannah.gnu.org/patch/?9719.
Inspired-by: Devin Hussey <husseydevin@gmail.com>
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/syntax/c.nanorc b/syntax/c.nanorc
@@ -1,6 +1,7 @@
## Here is an example for C/C++.
syntax c "\.([ch](pp|xx)?|C|cc|c\+\+|cu|H|hh|ii?)$"
+header "-\*-.*\<C(\+\+)?((;|\s).*)?-\*-"
magic "^(C|C\+\+) (source|program)"
comment "//"