lmburns / lf.nvim

Lf file manager for Neovim (in Lua)
MIT License
98 stars 12 forks source link

default_file_manager: expected boolean, got nil #18

Closed Dimfred closed 1 year ago

Dimfred commented 1 year ago

Hi and thanks for the plugin :)

One of the last 3 commits broke those functions:

M.lf.change_workspace = function()
    vim.g.is_floatterm = true
    local lf = require("lf")
    lf.start("~/workspaces", { default_action = "cd" })
end
M.lf.open_file = function()
    vim.g.is_floatterm = true
    local lf = require("lf", { default_action = "drop" })
    local res = lf.start()
end

The first command fails with:

E5108: Error executing lua .../dimfred/.local/share/nvim/lazy/vimpeccable/lua/vimp.lua:269: Error when executing map '<leader>po':
...dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf/config.lua:65: default_file_manager: expected boolean, got nil
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        ...dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf/config.lua:65: in function 'validate'
        ...dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf/config.lua:101: in function 'override'
        ...e/dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf/main.lua:70: in function 'new'
        /home/dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf.lua:127: in function 'start'
        /home/dimfred/.config/nvim/lua/user/commands.lua:238: in function </home/dimfred/.config/nvim/lua/user/commands.lua:235>
        [C]: in function 'xpcall'
        .../dimfred/.local/share/nvim/lazy/vimpeccable/lua/vimp.lua:265: in function '_executeMap'
        [string ":lua"]:1: in main chunk

stack traceback:
        [C]: in function 'error'
        .../dimfred/.local/share/nvim/lazy/vimpeccable/lua/vimp.lua:269: in function '_executeMap'
        [string ":lua"]:1: in main chunk

The second command failes with:

E5108: Error executing lua .../dimfred/.local/share/nvim/lazy/vimpeccable/lua/vimp.lua:269: Error when executing map '<leader>pt':
...e/dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf/main.lua:98: attempt to index field 'env' (a nil value)
stack traceback:
        ...e/dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf/main.lua:98: in function '__create_term'
        ...e/dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf/main.lua:83: in function 'new'
        /home/dimfred/.local/share/nvim/lazy/lf.nvim/lua/lf.lua:127: in function 'start'
        /home/dimfred/.config/nvim/lua/user/commands.lua:243: in function </home/dimfred/.config/nvim/lua/user/commands.lua:240>
        [C]: in function 'xpcall'
        .../dimfred/.local/share/nvim/lazy/vimpeccable/lua/vimp.lua:265: in function '_executeMap'
        [string ":lua"]:1: in main chunk

stack traceback:
        [C]: in function 'error'
        .../dimfred/.local/share/nvim/lazy/vimpeccable/lua/vimp.lua:269: in function '_executeMap'
        [string ":lua"]:1: in main chunk

Sry I am currently too lazy to debug, if something is broke, could you just tell me if I am using the commands correctly? I reverted for now to: c30426d2fb70ac3ada0dbc07f204dffb3293e86b

lmburns commented 1 year ago

Check the latest commit and see if your issue is resolved

Dimfred commented 1 year ago

Updated and everything seems to work again. Thanks for fixing. Closing.