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

Fix panic in select_textobject_around #9832

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

trink
Copy link
Contributor

@trink trink commented Mar 7, 2024

Test Document

a)b

Steps to Reproduce

  1. % # select_all
  2. ms( # surround_add
  3. mam # select_textobject_around

Debug and Release

thread 'main' panicked at 'Attempt to index past end of RopeSlice: char index 7, RopeSlice char length 6', ropey-1.6.1/src/slice.rs:796:13

Description

An index was selected beyond the end of the slice with chars_at. The fix adds a guard check to find_nth_open_pair, like in the other find_nth* functions.

Test Document
-------------
```
a)b
```

Steps to Reproduce
------------------
1. %   # select_all
1. ms( # surround_add
1. mam # select_textobject_around

Debug and Release
-----------------
`thread 'main' panicked at 'Attempt to index past end of RopeSlice:
char index 7, RopeSlice char length 6', ropey-1.6.1/src/slice.rs:796:13`

Description
-----------
An index was selected beyond the end of the slice with chars_at. The fix
adds a guard check to `find_nth_open_pair`, like in the other find_nth*
functions.
@archseer
Copy link
Member

archseer commented Mar 7, 2024

@trink I was wondering how you're catching all of these, are they coming up from daily use or do you have a fuzzer set up?

Thank you for all the fixes so far, especially since they come with test coverage!

@trink
Copy link
Contributor Author

trink commented Mar 7, 2024

@archseer I created a fuzzer because some came up in daily use :)

I was thinking about generalizing/cleaning it up for release. If you are interested let me know. It is scriptable and has the ability to stop before the failure, on playback, so you can set some breakpoints and interact with the editor etc. It also tracks all command timings to discover things like #5851.

@the-mikedavis the-mikedavis merged commit e27b047 into helix-editor:master Mar 7, 2024
6 checks passed
@the-mikedavis
Copy link
Member

That sounds very cool! I would definitely be interested in giving it a look and I'm sure @archseer would too

@trink trink deleted the find_nth_open_pair branch March 7, 2024 20:09
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
Test Document
-------------
```
a)b
```

Steps to Reproduce
------------------
1. %   # select_all
1. ms( # surround_add
1. mam # select_textobject_around

Debug and Release
-----------------
`thread 'main' panicked at 'Attempt to index past end of RopeSlice:
char index 7, RopeSlice char length 6', ropey-1.6.1/src/slice.rs:796:13`

Description
-----------
An index was selected beyond the end of the slice with chars_at. The fix
adds a guard check to `find_nth_open_pair`, like in the other find_nth*
functions.
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
Test Document
-------------
```
a)b
```

Steps to Reproduce
------------------
1. %   # select_all
1. ms( # surround_add
1. mam # select_textobject_around

Debug and Release
-----------------
`thread 'main' panicked at 'Attempt to index past end of RopeSlice:
char index 7, RopeSlice char length 6', ropey-1.6.1/src/slice.rs:796:13`

Description
-----------
An index was selected beyond the end of the slice with chars_at. The fix
adds a guard check to `find_nth_open_pair`, like in the other find_nth*
functions.
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
Test Document
-------------
```
a)b
```

Steps to Reproduce
------------------
1. %   # select_all
1. ms( # surround_add
1. mam # select_textobject_around

Debug and Release
-----------------
`thread 'main' panicked at 'Attempt to index past end of RopeSlice:
char index 7, RopeSlice char length 6', ropey-1.6.1/src/slice.rs:796:13`

Description
-----------
An index was selected beyond the end of the slice with chars_at. The fix
adds a guard check to `find_nth_open_pair`, like in the other find_nth*
functions.
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Test Document
-------------
```
a)b
```

Steps to Reproduce
------------------
1. %   # select_all
1. ms( # surround_add
1. mam # select_textobject_around

Debug and Release
-----------------
`thread 'main' panicked at 'Attempt to index past end of RopeSlice:
char index 7, RopeSlice char length 6', ropey-1.6.1/src/slice.rs:796:13`

Description
-----------
An index was selected beyond the end of the slice with chars_at. The fix
adds a guard check to `find_nth_open_pair`, like in the other find_nth*
functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants