-
released this
2026-11-19 10:35:11 -08:00 | 10 commits to master since this release`ifdefblocks fold, and pin in sticky scroll(
docs/features/ifdef-folding; TODO §71.4.)- Every conditional-compilation branch folds on its own.
`ifdef,
`ifndef,`elsifand`elseeach fold from their own line to
the line before the next branch (or before`endif). Collapse the
`ifdefbranch and the`elseline stays visible and separately
collapsible;`endifstays visible too, the wayenddoes for a
beginfold. Nesting works to any depth. - They pin in sticky scroll. The floating header lines already follow the
server's folds, so while you scroll inside a long branch its`ifdefor
`elseline stays at the top with the module and blocks around it. - Only real directives count. The folds are built from the lexer's own
directive tokens, so a directive-looking line inside a comment, a string or
a`definebody is not folded (35 such lines in OpenTitan). An
unterminated`ifdeffolds the branches it finished and never runs to
the end of the file; a stray`elseor`endifis ignored. - No existing fold is lost or changed. On OpenTitan's
hwtree (4 061
files) and the 860-file corpus every fold the previous release returned is
still returned, byte for byte, with the 1 061 and 511 branch folds added.
Where a branch would share its start line with an existing fold — a
directive written after code on the same line — the existing fold is sent
first and keeps its place; that never occurs in either tree. - Cost: one extra pass over the tokens: folding all of OpenTitan goes from
29.9 ms to about 34 ms, and a 50 000-branch file answers in 0.2 s. - Limits. Files over the large-file threshold (4 MiB) return no folds, as
before. Not yet seen in a running editor by a human.
Downloads
- Every conditional-compilation branch folds on its own.