Skip to content

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

@dukechill

Description

@dukechill

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:

  • I have confirmed that my configuration file is correctly loaded by lazyvim.
  • Based on the [current default settings in init.lua](
    win_position = 'right',
    ), it seems these options should be overridable.
  • Is there a new method to customize the window positions, or are these options being overridden by some internal logic in the current version?

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions