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: autostart=false: attach when editing new, nonexistent file (#2712 attempt 2) #3355

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Oct 2, 2024

  1. fix: consider attaching when editing new file

    BufReadPost does not trigger when editing a nonexistent file, so
    language servers would not automatically attach when editing a new file
    if autostart was disabled or if the server had no associated filetypes.
    This fixes that by adding BufNewFile to autocommands hooked to
    BufReadPost.
    Diomendius committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    fec78d9 View commit details
    Browse the repository at this point in the history
  2. fix: ensure try_add() runs after filetype detection

    Sometimes, BufNewFile triggers before 'filetype' is set. Using
    vim.schedule() should ensure filetype detection runs before the
    callback.
    Diomendius committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    52346b1 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2024

  1. fix: check buffer validity try_add()/try_add_wrapper()

    Currently avoids an issue where a `FileType` autocommand schedules a
    call to one of these functions but the buffer gets wiped out before the
    next event loop. `nvim_get_option_value()` with the `filetype` argument
    can cause this as it creates a transient buffer that only lasts for a
    single function call.
    Diomendius committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    a673c83 View commit details
    Browse the repository at this point in the history