luckasRanarison / nvim-devdocs

Neovim DevDocs integration
MIT License
270 stars 20 forks source link

Lua error when try to open help for selected word #62

Closed kobzar closed 1 year ago

kobzar commented 1 year ago

Make Fetch and install python3.11 Run DevOpsOpen(any variant) Find needed method - for example pathlib.Path.mkdir press Enter key and got the error

E5108: Error executing lua: ...e/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/operations.lua:279: Expected Lua number
stack traceback:
    [C]: in function 'nvim_buf_set_option'
    ...e/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/operations.lua:279: in function 'open'
    ...hare/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/pickers.lua:79: in function 'open_doc'
    ...hare/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/pickers.lua:168: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:257: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:256>
luckasRanarison commented 1 year ago

Did you set a custom value to row or col in float_win? Also could you provide your neovim version and the config used?

kobzar commented 1 year ago

I am use LazyVim https://www.lazyvim.org/configuration/plugins

Neovim: 0.9.4

I was try with different configuration like default e.t.c


return {
  "luckasRanarison/nvim-devdocs",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim",
    "nvim-treesitter/nvim-treesitter",
  },
  config = function()
    require("nvim-devdocs").setup()
  end,
}

and the same with

return {
  "luckasRanarison/nvim-devdocs",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim",
    "nvim-treesitter/nvim-treesitter",
  },
  config = function()
    require("nvim-devdocs").setup({

      dir_path = vim.fn.stdpath("data") .. "/devdocs", -- installation directory
      telescope = {}, -- passed to the telescope picker
      float_win = { -- passed to nvim_open_win(), see :h api-floatwin
        relative = "editor",
        height = 25,
        width = 100,
        border = "rounded",
      },
      wrap = false, -- text wrap, only applies to floating window
      previewer_cmd = nil, -- for example: "glow"
      cmd_args = {}, -- example using glow: { "-s", "dark", "-w", "80" }
      cmd_ignore = {}, -- ignore cmd rendering for the listed docs
      picker_cmd = false, -- use cmd previewer in picker preview
      picker_cmd_args = {}, -- example using glow: { "-s", "dark", "-w", "50" }
      after_open = function(bufnr)
        vim.api.nvim_buf_set_keymap(bufnr, "n", "<Esc>", ":close<CR>", {})
      end,
    })
  end,
}

Open with/without Float

image

After Enter error is present