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

Commits on Mar 2, 2024

  1. Fix panic when using join_selections_space

    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)
    trink committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    bab7b7c View commit details
    Browse the repository at this point in the history