aznhe21 / actions-preview.nvim

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

Window size #4

Closed agaro1121 closed 11 months ago

agaro1121 commented 1 year ago

The window size that pops up for me is on the smaller side and cuts off the diff. I had to make some adjustments to make everything fit.

using lazy nvim:

return {
  "aznhe21/actions-preview.nvim",
  config = function()
    require("actions-preview").setup {
      diff = {
        ctxlen = 3,
      },
      -- priority list of preferred backend
      backend = { "telescope" },
      -- options for telescope.nvim: https://github.com/nvim-telescope/telescope.nvim#themes
      telescope = require("telescope.themes").get_dropdown({
        layout_strategy = "center",
        layout_config = {
          height = function(_, _, max_lines)
            return math.min(max_lines, 30)
          end
        }
      }),
    }

    vim.keymap.set({ "v", "n" }, "gf", require("actions-preview").code_actions)
  end,
}

How can I get mine to look like the preview in the README?

aznhe21 commented 1 year ago

here is (part of) my config:

require("actions-preview").setup {
  telescope = {
    sorting_strategy = "ascending",
    layout_strategy = "vertical",
    layout_config = {
      width = 0.8,
      height = 0.9,
      prompt_position = "top",
      preview_cutoff = 20,
      preview_height = function(_, _, max_lines)
        return max_lines - 15
      end,
    },
  },
}

I would consider adding an example config page to the wiki, etc.