Closed HolyBlackCat closed 3 years ago
@HolyBlackCat thanks for sharing your rules. Your usage of the extension is way beyond its original purpose (emacs folding). :open_mouth:
For #define
, have you tried:
{
"begin": "#define",
"continuation": "\\"
}
The "beginRegex": "(?!)"
is baffling me... I will have check it...
@daiyam (?!)
is a regex that never matches anything. I'm basically exploiting #20. :P
The #define
is complicated, so I decided to just ignore it.
#define A /*
// this should be folded
#define B */
#define A {
// this shouldn't be folded
#define B }
The second case (unbalanced braces in #define
) almost never appear in actual code, so it's not a big loss.
Hello! Not sure if this is the right place to do it, but I just wanted to share the C/C++ folding rules ended up using.
What is folded:
{...}
,(...)
,[...]
R"(...)"
Folding doesn't happen inside of:
Known issues that I don't know how to fix:
\
at the end of line) is not handled correctly in string and character literals, line comments, and everywhere else.#define
should be ignored, but they aren't.Config: