None => true, // end of string
// not just before a combining character
- Some(c) => UnicodeWidthChar::width(c).unwrap_or(0) > 0,
+ Some(c) => c == '\n' ||
+ UnicodeWidthChar::width(c).unwrap_or(0) > 0,
}
}
}
ComposeLayoutCell { pos: 0, x: 0, y: 0 },
ComposeLayoutCell { pos: 1, x: 0, y: 1 }});
+ // And now two newlines
+ let composer = Composer::test_new(conf.clone(), "\n\n");
+ assert_eq!(composer.layout(10), vec!{
+ ComposeLayoutCell { pos: 0, x: 0, y: 0 },
+ ComposeLayoutCell { pos: 1, x: 0, y: 1 },
+ ComposeLayoutCell { pos: 2, x: 0, y: 2 }});
+
// Watch what happens just as we type text across a wrap boundary.
// At 8 characters, this should be fine as it is, since the wrap
// width is 1 less than the physical screen width and the cursor