Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic with strange file #115

Open
qarmin opened this issue Mar 27, 2023 · 1 comment
Open

Panic with strange file #115

qarmin opened this issue Mar 27, 2023 · 1 comment

Comments

@qarmin
Copy link

qarmin commented Mar 27, 2023

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
@0HyperCube
Copy link
Contributor

@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}'

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

No branches or pull requests

2 participants