Open devank4000 opened 4 days ago
Hi, While the added benefit of not having to specify the hl for every ft sounds nice, it creates problems that can be overlooked.
The solution is to prefer simplicity over complexity. I suggest you to use C preprocessor instead to make the copy pasting a bit easier.
Here's there solution i tried -
#define FILETYPES \
X("/") \
....
#define X(ft) \
{ft, "([ \t]+)\n$", {0, SYN_BGMK(9)}}, \
....
FILETYPES
#undef X
#undef FILETYPES
However this ignores the other highlights
Your best bet is doing this
#define all(ft) \
{ft, "([ \t]+)\n$", {0, SYN_BGMK(9)}}, \
And calling all("/") on every ft. Of course only do this if you have more than 1.
It would be nice to have a way to add highlight rules for all filetypes without copypasting the same rule for different filetypes. Would be especially useful for hll, hlw, hlp, trailing whitespaces and search keyword.