mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00

Problem: `vim.lsp.buf.[implementation|definition|...]({ reuse_win = true })` does not jump cursor to existing window if buffer is already open. Steps to reproduce: 1. `nvim repro.lua` 2. Insert anything that lsp can read to open the library definition/implementation, e.g., `vim.keymap.set` 3. open `repro.lua` buffer and the library buffer side by side. 4. type `gd` over `set` to jump to the library definition. The open buffer is scrolled to the target line, but cursor does not jump. Solution: Call nvim_set_current_win if necessary.