nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.41k stars 287 forks source link

The Peek Definition window is not aligned to left side when opened in a left side window of a split. #1396

Open madcdevelop opened 6 months ago

madcdevelop commented 6 months ago

Describe the bug

Repro Steps:

  1. Split the neovim window vertically.
  2. Call Peek Definition command on any symbol on the left split window.
  3. The Peek Definition window is not aligned to left side when opened in a left side window of a split.

These are my settings:

lspsaga.setup({
  ui = {
    border = "single",
    devicon = true,
    title = true,
  },
  lightbulb = {
    enable = false,
    enable_in_insert = true,
    sign = true,
    sign_priority = 40,
    virtual_text = true,
  },
  symbol_in_winbar = {
    enable = false,
    separator = " ",
    ignore_patterns={},
    hide_keyword = true,
    show_file = true,
    folder_level = 2,
    respect_root = false,
    color_mode = true,
  },
  definition = {
    width = 0.99,
    height = 0.4,
  },
})

LeftSideSplitIncorrectLocation LeftSide2_PreviewDefinition LeftSide_PreviewDefinition FullScreen_PreviewDefinition RightSide_PreviewDefinition

Steps to reproduce

use min.lua https://github.com/nvimdev/lspsaga.nvim/blob/main/test/minimal_test.lua for test nvim --clean -u min.lua example.lua

Repro Steps:

  1. Split the neovim window vertically.
  2. Call Peek Definition command on any symbol on the left split window.
  3. The Peek Definition window is not aligned to left side when opened in a left side window of a split.

I've reproduced this in a lua file and a c and cpp file types.

Expected behavior

The Preview Definition window should open up and align to the left side of the screen on a vertical split.

Neovim version (nvim -v)

0.9.5

lspsaga commit

b1b140aa20a0cf353cd3e282870429b48b30a169

Terminal name/version

Neovide, Windows Terminal