joshmedeski / telescope-smart-goto.nvim

A smart goto Telescope extension
MIT License
11 stars 0 forks source link

expected lua number error #7

Closed albohlabs closed 11 months ago

albohlabs commented 1 year ago

Hej, when calling :Telescope smart_goto i get the following error:

Error executing Lua callback: ...are/AstroVim/lazy/telescope.nvim/lua/telescope/utils.lua:226: Expected Lua number
stack traceback:
        [C]: in function 'nvim_win_get_width'
        ...are/AstroVim/lazy/telescope.nvim/lua/telescope/utils.lua:226: in function 'calc_result_length'
        ...are/AstroVim/lazy/telescope.nvim/lua/telescope/utils.lua:285: in function 'transform_path'
        ...lazy/telescope-smart-goto.nvim/lua/smart_goto/picker.lua:114: in function 'get_pretty_file_path'
        ...lazy/telescope-smart-goto.nvim/lua/smart_goto/picker.lua:123: in function 'entry_maker'
        ...scope.nvim/lua/telescope/finders/async_static_finder.lua:17: in function 'smart_goto_finder'
        ...lazy/telescope-smart-goto.nvim/lua/smart_goto/picker.lua:152: in function <...lazy/telescope-smart-goto.nvim/lua/smart_goto/picker.lua:145>
        ...e/AstroVim/lazy/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
        ...e/AstroVim/lazy/telescope.nvim/lua/telescope/command.lua:253: in function 'load_command'
        .../share/AstroVim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <.../share/AstroVim/lazy/telescope.nvim/plugin/telescope.lua:107>

Btw, thanks for sharing this nice idea. :heart:

joshmedeski commented 1 year ago

Looks like it has something to do with AstroVim config.

Can you show me how you define the plugin with AstroVim?

albohlabs commented 1 year ago

I have copied and pasted the snippet from the readme.md that is causing the error. After changing the config to the following it works.

return {
  "nvim-telescope/telescope.nvim",
  dependencies = {
    "ThePrimeagen/harpoon",
    "joshmedeski/telescope-smart-goto.nvim",
  },
  opts = function() require("telescope").load_extension "smart_goto" end,
}

Thank you.

albohlabs commented 1 year ago

No, it does not work. When I open the first buffer, the error happens again.

joshmedeski commented 1 year ago

I've done some investigation this morning and haven't pin pointed the issue yet. Something to do with the Telescope options. I'll keep looking into it this weekend and let you know when I figure it out!

joshmedeski commented 11 months ago

Figured out if you change the defaults path_displays to "smart" it should fix it.

    defaults = {
      path_display = { "smart" },

I will make sure the plugin can accept different path display values in the future.

albohlabs commented 11 months ago

Totally awesome. Thanks.