debugloop / telescope-undo.nvim

A telescope extension to view and search your undo tree 🌴
MIT License
614 stars 11 forks source link

No preview window #27

Closed silentjay closed 1 year ago

silentjay commented 1 year ago

When I open the plugin no preview window is shown.

image

My config is as follows:

  {
    "nvim-telescope/telescope.nvim",
    dependencies = {
      { "nvim-lua/plenary.nvim" },
      {
        "debugloop/telescope-undo.nvim",
        config = function(plugin, opts)
          require "plugins.configs.telescope" (plugin, opts) -- include the default astronvim config that calls the setup call
          local telescope = require "telescope"
          telescope.setup {
            pickers = { oldfiles = { cwd_only = true } }, -- only show files in current directory
            extensions = {
              undo = {
                use_delta = true,
                side_by_side = true,
                layout_strategy = "vertical",
                layout_config = {
                  preview_height = 0.8,
                },
              },
            },
          }
          telescope.load_extension "undo"
        end,
      },
    },
    keys = {
      { "<leader>fu", "<cmd>Telescope undo<cr>", desc = "Open File Undo His. in Telescope" },
    },
  },

Not sure if this is how I've had to integrate the plugin with astronvim's telescope integration. However changing layout_strategy to horizontal works as expected and the preview window is shown.

beyond-fu commented 1 year ago

If you want the preview result just like in README, use horizontal rather than vertical. Maybe it's the author's negligence in the configuratiojn part of README.

silentjay commented 1 year ago

Thanks as I mentioned horizontal works as expected, but was trying to get vertical to work. I suspect it might have something to do with my astronvim config but exactly what I couldn't work out. In the end I switched to a different plugin so I'll close this.

debugloop commented 1 year ago

Hi, pretty sure the issue was unrelated to the plugin. If your notification in the screen shot is any indication, you config tried to attach a LSP client to the preview buffer, failed, and closed the window? I can only guess if that is indeed the reason, but feel free to reopen with more info if you want to get to the bottom of this.