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 when using join_selections_space #9783

Merged
merged 1 commit into from
Mar 2, 2024

Conversation

trink
Copy link
Contributor

@trink trink commented Mar 2, 2024

Joining lines with Alt-J does not properly select the inserted spaces when the selection contains blank lines. In the worst case it panics with an out of bounds index.

thread 'main' panicked at 'called Result::unwrap() on an Err value: Char index out of bounds: char index 11, Rope/RopeSlice char length 10'

Steps to reproduce:

  • Create a new document
     a
    
     b
    
     c
    
     d
    
     e
    
  • % (Select all)
  • Alt-J (join and select the spaces)

Joining lines with Alt-J does not properly select the inserted spaces
when the selection contains blank lines. In the worst case it panics
with an out of bounds index.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Char index out of bounds: char index 11, Rope/RopeSlice char length 10'

Steps to reproduce:
* Create a new document
    ```
    a

    b

    c

    d

    e
    ```
* % (Select all)
* Alt-J (join and select the spaces)
@the-mikedavis the-mikedavis added C-bug Category: This is a bug S-waiting-on-review Status: Awaiting review from a maintainer. A-command Area: Commands labels Mar 2, 2024
@pascalkuthe pascalkuthe merged commit 5bd0072 into helix-editor:master Mar 2, 2024
6 checks passed
@trink trink deleted the join_selections_space branch March 2, 2024 15:27
Desdaemon pushed a commit to Desdaemon/helix that referenced this pull request Mar 4, 2024
Joining lines with Alt-J does not properly select the inserted spaces
when the selection contains blank lines. In the worst case it panics
with an out of bounds index.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Char index out of bounds: char index 11, Rope/RopeSlice char length 10'

Steps to reproduce:
* Create a new document
    ```
    a

    b

    c

    d

    e
    ```
* % (Select all)
* Alt-J (join and select the spaces)
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
Joining lines with Alt-J does not properly select the inserted spaces
when the selection contains blank lines. In the worst case it panics
with an out of bounds index.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Char index out of bounds: char index 11, Rope/RopeSlice char length 10'

Steps to reproduce:
* Create a new document
    ```
    a

    b

    c

    d

    e
    ```
* % (Select all)
* Alt-J (join and select the spaces)
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
Joining lines with Alt-J does not properly select the inserted spaces
when the selection contains blank lines. In the worst case it panics
with an out of bounds index.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Char index out of bounds: char index 11, Rope/RopeSlice char length 10'

Steps to reproduce:
* Create a new document
    ```
    a

    b

    c

    d

    e
    ```
* % (Select all)
* Alt-J (join and select the spaces)
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
Joining lines with Alt-J does not properly select the inserted spaces
when the selection contains blank lines. In the worst case it panics
with an out of bounds index.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Char index out of bounds: char index 11, Rope/RopeSlice char length 10'

Steps to reproduce:
* Create a new document
    ```
    a

    b

    c

    d

    e
    ```
* % (Select all)
* Alt-J (join and select the spaces)
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Joining lines with Alt-J does not properly select the inserted spaces
when the selection contains blank lines. In the worst case it panics
with an out of bounds index.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Char index out of bounds: char index 11, Rope/RopeSlice char length 10'

Steps to reproduce:
* Create a new document
    ```
    a

    b

    c

    d

    e
    ```
* % (Select all)
* Alt-J (join and select the spaces)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands C-bug Category: This is a bug S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants