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: write-all crash #4384

Merged

Commits on Oct 20, 2022

  1. fix: write-all crash

    When we do auto formatting, the code that takes the LSP's response and applies
    the changes to the document are just getting the currently focused view and
    giving that to the function, basically always assuming that the document that
    we're applying the change to is in focus, and not in a background view.
    
    This is usually fine for a single view, even if it's a buffer in the
    background, because it's still the same view and the selection will get updated
    accordingly for when you switch back to it. But it's obviously a problem for
    when there are multiple views, because if you don't have the target document in
    focus, it will ask the document to update the wrong view, hence the crash.
    
    The problem with this is picking which view to apply any selection change to.
    In the absence of any more data points on the views themselves, we simply pick
    the first view associated with the document we are saving.
    dead10ck committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    cece71a View commit details
    Browse the repository at this point in the history