nvim-neo-tree / neo-tree.nvim

Neovim plugin to manage the file system and other tree like structures.
MIT License
3.38k stars 207 forks source link

BUG: Expected Lua number error #1240

Open s1n7ax opened 7 months ago

s1n7ax commented 7 months ago

Did you check docs and existing issues?

Neovim Version (nvim -v)

NVIM v0.9.4 Build type: Release LuaJIT 2.1.1693350652

Operating System / Version

NixOS 23

Describe the Bug

When the neo-tree is opened, sometimes I see this error. I see this error only some times. Even though this occurs, neo tree is working without any issue as far as I can see.

Screenshots, Traceback

E5108: Error executing lua: ...ax/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:261: Expected Lua number
stack traceback:
    [C]: in function 'nvim_win_get_cursor'
    ...ax/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:261: in function 'get_node'
    ...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:516: in function <...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:515>

Steps to Reproduce

I have no clue why I see this sometimes. I'm using AstroNvim and this is the configuration they are using

https://github.com/AstroNvim/AstroNvim/blob/5ca63145b169a7f7fe751b2b310233e5066ea4a6/lua/plugins/neo-tree.lua

I have overridden two things here as below,

return {
    'nvim-neo-tree/neo-tree.nvim',
    opts = function(_, neotree_conf)
        neotree_conf.window.mappings.e = 'none'
        neotree_conf.window.position = 'float'

        return neotree_conf
    end,
}

I use Neotree toggle command to open neo-tree

Expected Behavior

No error

Your Configuration

-
NielsCodes commented 7 months ago

Same issue here