Skip to content

Panic when selecting text (assertion failed: self.is_char_boundary(at)) #750

@TehPers

Description

@TehPers

Describe the bug

Nushell seems to panic when selecting text that includes a hyphen.

How to reproduce

  1. Type git checkout abc-123
  2. ctrl + left to place cursor after the last hyphen (right before the 1)
  3. shift + ctrl + left to attempt to select abc-

Attempting to ctrl+select -123 using ctrl + shift + right also triggers it.

Expected behavior

It should select abc- (or -123 going the other direction) without any panics.

Screenshots

Windows Terminal:
image

vscode:
image

With RUST_BACKTRACE = "full" after cargo install --profile dev nu:
image

(Relevant part of path in error: reedline-0.29.0\src\painting\styled_text.rs:61:58)

Configuration

key value
version 0.90.1
branch
commit_hash
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.76.0 (07dca489a 2024-02-04)
rust_channel stable-x86_64-pc-windows-msvc
cargo_version cargo 1.76.0 (c84b36747 2024-01-18)
build_time 2024-02-08 22:43:24 -08:00
build_rust_channel release
allocator mimalloc
features dataframe, default, extra, sqlite, trash, which, zip
installed_plugins

Additional context

OS: Win 11 Pro
Terminal: Windows Terminal

Also, I'm using starship and carapace, if that's relevant. Was able to reproduce in vscode using ctrl+shift+right to attempt to select -123.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions