Skip to content

Panic when searching for German umlauts #146

@nwagner84

Description

@nwagner84

Describe the bug

When searching for the phase "tüt" my program panics.

To Reproduce

$ cargo build --all-features --example less-rs
$ echo "foo" > foo.txt
$ ./target/debug/examples/less-rs foo.txt
$ # Enter "/tüt"
thread '<unnamed>' panicked at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/string.rs:1653:9:
assertion failed: self.is_char_boundary(idx)
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:662:5
   1: core::panicking::panic_fmt
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:74:14
   2: core::panicking::panic
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:148:5
   3: alloc::string::String::insert
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/string.rs:1653:9
   4: minus::search::handle_key_press
             at ./src/search.rs:542:13
   5: minus::search::fetch_input
             at ./src/search.rs:596:13
   6: minus::minus_core::ev_handler::handle_event
             at ./src/core/ev_handler.rs:103:33
   7: minus::minus_core::init::start_reactor
             at ./src/core/init.rs:258:17
   8: minus::minus_core::init::init_core::{{closure}}::{{closure}}
             at ./src/core/init.rs:177:23
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Expected behavior

The library should not panic.

Desktop:

  • OS: Ubuntu 22.04.4 LTS (Linux 5.15.0-113-generic)
  • Shell: ZSH
  • minus Version 5.6.1

Additional context

German umlauts like "ü" (U+00FC), ä, etc. might be the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions