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

Command suggestions sometimes panic in self.is_char_boundary(n) #1888

Closed
ReagentX opened this issue Mar 30, 2022 · 9 comments
Closed

Command suggestions sometimes panic in self.is_char_boundary(n) #1888

ReagentX opened this issue Mar 30, 2022 · 9 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@ReagentX
Copy link

Summary

Using tab to complete/cycle through completion options sometimes crashes with the following message:

thread 'main' panicked at 'assertion failed: self.is_char_boundary(n)', /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/alloc/src/string.rs:1718:29

Reproduction Steps

I tried this:

  1. hx
  2. type :theme
  3. press tab to start autocomplete
  4. Space to select theme
  5. tab again to select from the theme list

I expected this to happen:

The selection moves through the theme list

Instead, this happened:

thread 'main' panicked at 'assertion failed: self.is_char_boundary(n)', /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/alloc/src/string.rs:1718:29

Helix log

~/.cache/helix/helix.log is empty

Platform

macOS

Terminal Emulator

alacritty 0.10.1 (2844606)

Helix Version

helix 22.03 (d4e45fd)

@ReagentX ReagentX added the C-bug Category: This is a bug label Mar 30, 2022
@ReagentX ReagentX changed the title Command suggestions sometimes crashes in self.is_char_boundary(n) Command suggestions sometimes panic in self.is_char_boundary(n) Mar 30, 2022
@sudormrfbin
Copy link
Member

Duplicate of #1246, but it's still not reproducible in my machine :/

@archseer
Copy link
Member

archseer commented Apr 1, 2022

Can you get us a full backtrace by setting the env RUST_BACKTRACE=1?

@ReagentX
Copy link
Author

ReagentX commented Apr 1, 2022

I tried that, but there was no additional output.

@archseer
Copy link
Member

archseer commented Apr 7, 2022

I tried that, but there was no additional output.

Did you export the env var? What exactly did you run

@archseer
Copy link
Member

archseer commented Apr 7, 2022

Feels like the range returned by completions isn't aligned to a char which then causes replace_range to panic

let (range, item) = &self.completion[index];

@archseer
Copy link
Member

archseer commented Apr 7, 2022

Could also be because the completion isn't recalculated when you press tab, but the completions are all calculated from what the original input was

@archseer
Copy link
Member

archseer commented Apr 7, 2022

Based on the trace in the other issue that seems to be it: #2004 (comment)

@pascalkuthe
Copy link
Member

I tried to reproduce this by the various methods described. No matter how long I spam any keys or try I can't reproduce this. Is it possible this has been fixed? There were quite a few reports around April last year but nothing since

@gabydd
Copy link
Member

gabydd commented Jul 14, 2023

yeah you are correct @pascalkuthe this looks like it was fixed by #3193

@gabydd gabydd closed this as completed Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

6 participants