Summary: | syntax/folding (C/C++): "#..." interferes with std block "{" folding | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | Torsten Eichstädt <walter.von.entferndt> |
Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | REPORTED --- | ||
Severity: | normal | CC: | christoph, nibgonz, walter.von.entferndt |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | FreeBSD Ports | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | freebsd's usr.sbin/powerd/powerd.c |
Description
Torsten Eichstädt
2020-06-06 07:39:11 UTC
Created attachment 129097 [details]
freebsd's usr.sbin/powerd/powerd.c
This is very difficult to fully correct. One solution may be to disable the folding of "{" and "}" inside the block "#else" - "#endif". For example: #ifdef SOMETHING if (a >= b || b >= c) { // <-- Here folding in "{" is activated #else if (a < b && b < c) { // <-- Here folding is disabled #endif /* code */ } Hello Nibaldo, 1. Nested regions are hairy... ;) 2. I do not remember if I did this right in prolog.xml: it has user regions (%BEGIN...%END; '%' is Prolog's one-line comment starter), and the usual folding for blocks and multi-line comments. I do not have downloaded the KDE sources yet, so I can not have a look myself. Maybe you like to have a look? Chances are I figured s/th out when I wrote that. 3. Yes, I agree. A practical solution would be to start as you suggested. A really useful enhancement would be to switch activation based on which part of the '#if...#el...#endif' is folded. Then folding would reflect which parts of the code are active. THX & good luck I forgot: keep in mind there can be multiple blocks '#if...#elif...#elif...#else...#endif' so it would be good to switch activation to the next block, then to the next etc.pp. |