https://bugs.kde.org/show_bug.cgi?id=422521
Bug ID: 422521
Summary: syntax/folding (C/C++): "#..." interferes with std
block "{" folding
Product: kate
Version: 19.12.3
Platform: FreeBSD Ports
OS: FreeBSD
Status: REPORTED
Severity: normal
Priority: NOR
Component: syntax
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
This has a subtle bad (buggy) consequence: The whole part of the file after
the function where the "#..." occurs gets hidden. Very nasty... ;)
If s/o fixes this: IMHO the region of any "#if" (or "#ifdef" or such) should
only span until an "#else" or "#elif", if such occurs. Any "#elif" or "#else"
should start an own region until the next "#elif", "#else" or "#end".
Alternatively the "#elif" and "#else" could be sub-regions (then the starting
"#if" must start two regions: outer->"#end", inner->"#el..."), but IMHO w/o
sub-regions the user sees what the compiler sees (after the preprocessor, which
processes the "#..." stuff), and that's what s/he is interested in. As it is
now, the folding of preproccessor directives ("#...") is so that I can fold
s/th that does not match to what gets compiled.
STEPS TO REPRODUCE
1. Open the file "powerd.c" (attachment)
2. Point the mouse at the closing brace "}" of that function (line 397), and
note where the region begins.
3. Point the mouse at the previous closing brace (line 396), and note where
the region begins. Very interesting...
4. Fold the function acline_read() (line 327): the whole rest of the file
gets hidden.
OBSERVED RESULT
Folding a region that contains overlaping sub-regions brings the folding engine
out of sync. Sorry I can't explain it better...
EXPECTED RESULT
"PERFECT" behaviour ;)
SOFTWARE/OS VERSIONS
Windows: igitt!
macOS:
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: 5.13.2
ADDITIONAL INFORMATION
THX for everything
--
You are receiving this mail because:
You are watching all bug changes.