aznhe21 / actions-preview.nvim

Fully customizable previewer for LSP code actions.
GNU General Public License v3.0
365 stars 9 forks source link

How to make the menu relative (nui) #41

Closed ilan-schemoul closed 3 months ago

ilan-schemoul commented 3 months ago

Hey, I don't like how the menu takes the fullscreen I much prefer the https://github.com/weilbith/nvim-code-action-menu where the menu is relative to the cursor (otherwise I lose focus and the context of the rest of my code) image

I tried the following but it's not working

    backend = { "nui", "telescope" },
    nui = {
      layout = {
        relative = "cursor",
        position = {
          row = "100",
          col = "1",
        },
        size = {
          width = "20%",
          height = "20%",
        },
      },
    },
ilan-schemoul commented 3 months ago

Well for now I can use telescope with theme cursor

  config = function(_, opts)
    require("actions-preview").setup({
      backend = { "telescope", "nui" },
      telescope = vim.tbl_extend(
        "force",
        -- telescope theme: https://github.com/nvim-telescope/telescope.nvim#themes
        require("telescope.themes").get_cursor(),
        {
          make_value = nil,
          make_make_display = nil,
          previewer = false,
        }
      ),
    })
  end,

I don't think I can hide the prompt which is a bit annoying (telescope problem not related to this package) Capture d'écran 2024-05-04 140931

aznhe21 commented 3 months ago

Thank you for your report. With #43, the relative = "cursor" setting now works in the nui backend.

Also, telescope is just a fuzzy finder, so I don't think you can hide the prompt.