Skip to content

lsp_definitions() jump_type ignored if the target buffer is opened in a window #2690

@konart

Description

@konart

Description

Not sure if bug or "just as planned" but from the description:

        {jump_type}     (string)   how to goto definition if there is only one
                                   and the definition file is different from
                                   the current file, values: "tab", "split",
                                   "vsplit", "never"
...
        {reuse_win}     (boolean)  jump to existing window if buffer is
                                   already opened (default: false)

Given that the user have a method under the cursor and method's definition in the same buffer

I'd expect that setting jump_type to vsplit and (optionally?) setting reuse_win to false (default) will create a new window with the same buffer.

What actually happens: cursos simply jumps to definition withou leaving the existing window.

Neovim version

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

macOS 13.5

Telescope version / branch / rev

master

checkhealth telescope

telescope: require("telescope.health").check()

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0
- OK fd: found fd 8.7.0

===== Installed extensions ===== ~

Telescope Extension: `yank_history` ~
- No healthcheck provided

Telescope Extension: `zf-native` ~
- No healthcheck provided

Steps to reproduce

  1. Move cursor to a method X such that it has its definition in the same file\buffer
  2. Call require("telescope.builtin").lsp_definitions({jump_type="vsplit"})

Expected behavior

New vertical split created with the definition of X under the cursor

Actual behavior

Cursor jumps to a definition in active window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions