codersauce / red

:memo: Vimlike Modal Text Editor in Rust
132 stars 4 forks source link

opening red and pressing 'q' causes crash (and sometimes produces strange output) #51

Open erf opened 7 months ago

erf commented 7 months ago

recreate:

cargo run
q

crashes with the following message:

index out of bounds: the len is 2212 but the index is 2212

I also noticed sometimes when i open red again after that, it crashes automatically. I think it is because some process (the LSP client?) is not closed down properly and is producing some escape codes still. I noticed this when i opened my own videditor in insert mode.

version: d1b337c os: macOS

fcoury commented 7 months ago

Can you send me your red/config.toml please? I can't replicate this one.

fcoury commented 7 months ago

I was able to replicate it in insert mode I think!

fcoury commented 7 months ago

Here's the backtrace:

panicked at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/string.rs:1643:9:
assertion failed: self.is_char_boundary(idx)
panicked at src/lsp/mod.rs:296:22:
called `Result::unwrap()` on an `Err` value: SendError { .. }
erf commented 7 months ago

Can you send me your red/config.toml please? I can't replicate this one.

I copied the default_config.toml file at the mentioned commit.

You didn't get the error when pressing "q" in normal mode?

That's a different error than mine.