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

Plugin doesn't work in Neovim version 0.9.5 #73

Closed
Makary01 opened this issue Jun 5, 2024 · 1 comment
Closed

Plugin doesn't work in Neovim version 0.9.5 #73

Makary01 opened this issue Jun 5, 2024 · 1 comment

Comments

@Makary01
Copy link

Makary01 commented Jun 5, 2024

Description

When I installed the plugin with Neovim in version 0.9.5 I couldn't use any commands and when I executed the command :lua require'sf.util'.get_sf_root() from README.md results in the error message in line 34 of the file sf.nvim/lua/sf/util.lua:

E5108: Error executing lua [string ":lua"]:1: attempt to index field 'uv' (a nil value)

To Reproduce

  1. Install Neovim version 0.9.5.
  2. Install the plugin with Packer with
    -- packer.lua
    use {
        'xixiaofinland/sf.nvim',
        requires = {
            'nvim-treesitter/nvim-treesitter',
            'ibhagwan/fzf-lua',
        }
    }
    with default setup
    -- ~/.config/nvim/after/plugin/sf.lua
    require('sf').setup()
  3. Execute command :lua require'sf.util'.get_sf_root()

Workaround

update Neovim to version 0.10.0

My thoughts

I think the issue is likely caused by the absence of vim.uv in Neovim versions below 0.10.0 as this answer to a similar issue suggests and because updating the Neovim to version 0.10.0 solved the problem.

If this is the case, I don't know if it's fixable (I'm very new to Neovim and lua), but adding information in the Prerequisites section about the required version number could be sufficient

I'm also new to Github Issues so if you need me to include more information, let me know

@xixiaofinland
Copy link
Owner

Hi,

Thanks for mentioning this! Indeed vim.uv is introduced in v0.10 only. It can be easily replaced by vim.loop, supported by the older version.
However, I decide to keep the code unchanged and put v0.10 in the prerequisite section to motivate ppl use the latest version.
Nvim is moving forward rapidly and v0.10 stable version was already announced. There is really no reason to use v0.9x.

If more people demand the support of older versions, I will consider it again :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants