Skip to content

fix(text): TextSpec is 224 bytes again, so rune compiles - #2227

Merged
Hona merged 1 commit into
devfrom
fix/textspec-size
Nov 25, 2026
Merged

Hona merged 1 commit into
devfrom
fix/textspec-size

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

dev does not compile since #2206: TextSpec grew from 224 to 232 bytes, and the compile-time assert on its size fails on every 64-bit target. This puts it back at 224 without raising the number.

Why

crates/rune/src/el/text_spec.rs asserts size_of::<TextSpec>() == 224. That is the weight every text carries (#579 brought it from 744). #2206 added one bool to the struct, selectable_cursor, which no longer fit in the padding:

error[E0080]: evaluation panicked: assertion failed: std::mem::size_of::<TextSpec>() == 224
error: could not compile `rune` (lib) due to 1 previous error

Seen on Windows x64 and on macOS at 349970042. Every commit from 38f8dc54c on has it.

What changes

fade_em, the width in ems of a truncate_fade edge, moves from TextSpec into TextCold, where a text's rarely set fields wait behind one box. The new flag takes the room it leaves.

  • The usual width (TRUNCATE_FADE_EM, 1.5) is the cold block's default, so El::truncate_fade() writes nothing and allocates nothing. Only El::truncate_fade_width with another width writes it.
  • The painter reads spec.cold.fade_em. Nothing else read the field.

What it can change for an app

Nothing it can see: the same fade at the same width. A text is 224 bytes again instead of 232.

Run

  • Windows x64 (dev 349970042 plus this): rune compiles. cargo test -p rune --lib -- truncate selection_enabled fade inline_icon: 69 passed, 0 failed. cargo test -p rune-kit --test integration: 308 passed, 0 failed.
  • macOS (this repository's macOS tests, by hand on this branch, run 45580577397): rune compiles; its library tests are green (3,338 passed, 0 failed), and every other test binary is green except one test of rune-kit's integration tests, diff_custom::file_header_replaces_built_in_header_in_list_and_sticky_overlay_and_toggles_collapse (307 passed, 1 failed). That one was red on macOS before dev stopped compiling, passes on Windows, and is a paint-keep self-check, not this change; it is being looked at separately.

#2206 added a bool (selectable_cursor) to TextSpec, which made it 232 bytes; the compile-time assert on its size (224, the budget of #579) then failed, and rune no longer compiled on any 64-bit target. fade_em, the width of a truncate_fade edge that few texts set, moves behind the cold box, where a text's rarely set fields wait; the new flag takes its room. The usual width is the cold block's default, so truncate_fade allocates nothing.
@Hona
Hona marked this pull request as ready for review November 25, 2026 09:02
@Hona
Hona merged commit d74f116 into dev Nov 25, 2026
2 of 3 checks passed
@Hona
Hona deleted the fix/textspec-size branch November 25, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant