nvimdev / nvimdev/lspsaga.nvim

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

Open
#1,396 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
3.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

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.
  • When opening with no split or opening on the right side of a split the preview definition window aligns to the full size of the screen or the 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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/minimal_test.lua and reproduce the issue using nvim --clean -u min.lua example.lua. Then trace the Peek Definition window positioning for a vertically split Neovim window, especially when the current split is on the left. Done means the preview aligns with the left side of its split in the reported cases without changing the existing full-screen or right-split behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.