• v0.65.4
    release / build-and-publish (push) Successful in 5m44s
    Stable

    gitea-actions released this 2026-11-19 10:35:11 -08:00 | 10 commits to master since this release

    `ifdef blocks fold, and pin in sticky scroll

    (docs/features/ifdef-folding; TODO §71.4.)

    • Every conditional-compilation branch folds on its own. `ifdef,
      `ifndef, `elsif and `else each fold from their own line to
      the line before the next branch (or before `endif). Collapse the
      `ifdef branch and the `else line stays visible and separately
      collapsible; `endif stays visible too, the way end does for a
      begin fold. 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 `ifdef or
      `else line 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 `define body is not folded (35 such lines in OpenTitan). An
      unterminated `ifdef folds the branches it finished and never runs to
      the end of the file; a stray `else or `endif is ignored.
    • No existing fold is lost or changed. On OpenTitan's hw tree (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