Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whaler Explore command not found when configuring another file explorer #22

Open
mcp1766 opened this issue Nov 2, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mcp1766
Copy link

mcp1766 commented Nov 2, 2024

Try to configure Whaler but no matter which file explorer to configure and also the command, it always launch Explore that I dont have.
This is my configuration in Telescope
`
",y",

     function()
        local telescope = require("telescope")
        --vim.keymap.set("n", "<leader>fw", function()
        telescope.extensions.whaler.whaler({
           directories = { "/home/mcp/tmp/", "/home/mcp/Projets/", "/home/mcp/notes/" },
           oneoff_directories = { "/home/mcp/.config/nvim" },
           auto_file_explorer = true,
           auto_cwd = true,
           file_explorer = "nvimtree",
           file_expplorer_config = {
              hidden = false,
              plugin_name = "nvim-tree",
              command = "NvimTreeOpen",
              prefix_dir = " ",
           },
           theme = {
              result_title = "Your selection..",
              layout_strategy = 'center',
              previewer = false,
              layout_config = {
                 height = 0.3,
                 width = 0.3,
              },
              sorting_strategy = "ascending",
              border = true,type (expected: string or dictionary)
 }
        })
        -- end)
     end,
     desc = "Open Whaler",
  },

`

And the error:

type (expected: string or dictionary)
E5108: Error executing lua: ...im/lazy/whaler/lua/telescope/_extensions/whaler/main.lua:175: Error while parsing command line: E492: Commande inconnue: Explore /home/mcp/tmp/git-test2

stack traceback:
[C]: in function 'nvim_parse_cmd'
...im/lazy/whaler/lua/telescope/_extensions/whaler/main.lua:175: in function 'run_replace_or_original'

@SalOrak SalOrak self-assigned this Nov 8, 2024
@SalOrak SalOrak added the bug Something isn't working label Nov 8, 2024
@SalOrak
Copy link
Owner

SalOrak commented Nov 8, 2024

Hi @mcp1766! Thanks for the issue, I've found a bug due to this issue but it is not currently affecting your configuration.

The problem here comes from 2 points:

  1. The configuration snippet you have send has a mispelled word, it is file_explorer_config not file_expplorer_config (notice the two p).
  2. A bug, well, an "edge" case. The whaler function does not create a file_explorer_config from the file_explorer. So passing the latter to the function does not properly create the file_explorer_config thus not configuring

Note: You only need to configure either file_explorer or file_explorer_config. The first is an alias that creates the latter magically at setup. From the snippet you provided I'm guessing you are trying to run it directly as a function without initializing (executing setup function) whaler.

Hope it helps you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants