cosmic-text
cosmic-text copied to clipboard
Panic with strange file
Modifying editor-test
let text = if let Some(arg) = env::args().nth(1) {
fs::read_to_string(&arg).expect("failed to open file")
} else {
#[cfg(feature = "mono")]
let default_text = include_str!("../../../sample/a.txt");
#[cfg(not(feature = "mono"))]
let default_text = include_str!("../../../sample/a.txt");
default_text.to_string()
};
and putting to sample file - ss.txt.zip
crash app with info
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `Cursor { line: 0, index: 11747, affinity: After }`,
right: `Cursor { line: 0, index: 11743, affinity: After }`', examples/editor-test/src/main.rs:99:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@quarmin This is because your file contains a U+009A | Single Character Intro Introducer
which cosmic text does not insert because it is a unicode control character:
Refusing to insert control character '\u{9a}'