Skip to content

should_attach is often called with wrong buffer id/name #504

@powerman

Description

@powerman

To confirm this issue just log should_attach args in any of these cases:

  • start Neovim with multiple files open
  • use lazy loading (as shown in README), start Neovim, open multiple files without triggering lazy loading (do not enter Insert mode), then enter Insert mode

At a glance the issue happens because:

  • util.should_attach checks a current buffer
  • but it is called from background (it's callee runs under vim.schedule)
  • it is called just once on start (in client.setup) while multiple buffers might exists at that moment because of lazy loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions