Skip to main content

max / makeover-immediate

0.29.1: a markdown field gets a multi-line edit makeover-layout 0.30.0 adds FieldKind::Rich, and the multiline test was a matches! against the one member, so a markdown field would have got a single-line TextEdit -- a control the value cannot fit in. Keyed on FieldKind::multiline now, which is the method that arrived upstream for this. egui does nothing else with the markdown, and that is the honest answer rather than a gap: the source is text, and editing it as text loses none of it.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-18 20:30 UTC
Signed with PGP, not checked
Commit: ae0d274742f900a611babd35be3ceec8a6f51f45
Parent: 550b50f
2 files changed, +16 insertions, -3 deletions
M Cargo.toml +2 -2
@@ -1,6 +1,6 @@
1 1 [package]
2 2 name = "makeover-immediate"
3 - version = "0.29.0"
3 + version = "0.29.1"
4 4 edition = "2024"
5 5 description = "The immediate-mode renderer for makeover-layout. Immediate mode is the constraint that matters, not the library: no cascade, no retained tree, one stroke per widget. Backed by egui."
6 6 license = "MIT"
@@ -12,7 +12,7 @@
12 12 # Exact patch rather than the minor, as the rest of the suite pins: a
13 13 # minor-only requirement is satisfied by a consumer lock holding an earlier
14 14 # patch, which then fails to compile against an API added in a later one.
15 - makeover-layout = "0.29.1"
15 + makeover-layout = "0.30.0"
16 16
17 17 [lints.rust]
18 18 unused = "warn"
M src/lib.rs +14 -1
@@ -798,7 +798,13 @@
798 798 // An empty frame and no margin: the well is this crate's, and egui's
799 799 // own control background and padding would sit underneath it saying
800 800 // something different about both.
801 - let mut edit = if matches!(field.kind, FieldKind::Textarea) {
801 + // Keyed on the description's own `multiline` and not on the
802 + // member: a markdown field is several lines by definition, and a
803 + // single-line edit would be a control the value cannot fit in. egui
804 + // does nothing else with the markdown, which is the honest answer
805 + // rather than a gap -- the source is text, and editing it as text
806 + // loses none of it.
807 + let mut edit = if field.kind.multiline() {
802 808 TextEdit::multiline(text)
803 809 } else {
804 810 TextEdit::singleline(text)
@@ -1274,9 +1280,16 @@
1274 1280 FieldKind::Url,
1275 1281 FieldKind::Tel,
1276 1282 FieldKind::Textarea,
1283 + FieldKind::Rich,
1277 1284 ] {
1278 1285 assert_eq!(control_shape(k), Control::Typed, "{k:?} is typed into");
1279 1286 }
1287 + // And the two multi-line ones get a multi-line edit, which is the half
1288 + // `control_shape` alone does not say: both are typed into, and only one
1289 + // of the two edit shapes can hold a markdown document.
1290 + assert!(FieldKind::Rich.multiline());
1291 + assert!(FieldKind::Textarea.multiline());
1292 + assert!(!FieldKind::Text.multiline());
1280 1293 }
1281 1294
1282 1295 #[test]