nvimdev / nvimdev/lspsaga.nvim

Floating window position configuration (win_config) options not taking effect in lazyvim

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

Nobody has claimed this yet.

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

Description

I'm using lspsaga with lazyvim and I'm trying to customize the floating window positions by overriding the win_config for the definition and finder windows. However, despite my settings, the window positions remain at their default locations.

Environment:

  • lspsaga version: 6063935
  • lazyvim for plugin management
  • Neovim version: NVIM v0.10.4

Steps to Reproduce:

  1. Add the following configuration to your lazyvim plugin configuration file (e.g., ~/.config/nvim/lua/plugins/lspsaga.lua):
return {
  {
    "nvimdev/lspsaga.nvim",
    event = "LspAttach",
    config = function()
      require("lspsaga").setup({
        ui = {
          border = "rounded",
        },
        definition = {
          win_config = {
            relative = "editor",
            anchor = "NW",  -- intended position: top left corner
            row = 2,
            col = 2,
            width = 80,
            height = 20,
          },
        },
        finder = {
          win_config = {
            relative = "editor",
            anchor = "NW",
            row = 2,
            col = 2,
            width = 80,
            height = 20,
          },
        },
      })
    end,
    keys = {
      { "<leader>pd", "<cmd>Lspsaga peek_definition<CR>", desc = "Peek Definition" },
      { "<leader>pr", "<cmd>Lspsaga finder<CR>", desc = "Peek References" },
    },
  },
}
  1. Launch Neovim and trigger the peek_definition or finder commands.
  2. Observe that the floating window positions do not change as configured.

Expected Behavior:
The floating windows (for definition and finder) should appear at the specified positions (anchor = NW, row = 2, col = 2, etc.).

Actual Behavior:
The floating windows still appear in the default positions, ignoring my custom win_config settings.

Additional Information:

Thank you for your help!

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 the default window configuration in lua/lspsaga/init.lua at the linked definition near line 138. Trace how the definition and finder commands consume win_config, then verify why the supplied relative, anchor, row, col, width, and height values are not applied. Done means both floating windows honor the configured positions when triggered in Neovim.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.