helix-mods/helix-core
Mike Trinkala ef221abe83
Prevent a panic when uncommenting a line with only a comment token (#5933)
Open a new document `test.rs` and type the following:
`di//<esc><C-c>`

The margin calculation pushes the range out of bounds for the comment
marker when there are no characters (newline) after it.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Char range out of bounds: char range 0..3,
Rope/RopeSlice char length 2', ropey-1.6.0/src/rope.rs:546:37

The debug build catches the error in the transaction: thread 'main'
panicked at 'attempt to subtract with overflow',
helix-core/src/transaction.rs:503:26
2023-02-12 13:13:22 -06:00
..
src Prevent a panic when uncommenting a line with only a comment token (#5933) 2023-02-12 13:13:22 -06:00
tests Fix compatibility with toml 0.6.0 2023-01-24 12:50:46 -06:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
Cargo.toml build(deps): bump ropey from 1.5.1 to 1.6.0 (#5859) 2023-02-06 17:44:26 -06:00