nvim-neo-tree / neo-tree.nvim

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

BUG: renderer.lua:431: '=' expected near 'continue' #1330

Open subnut opened 8 months ago

subnut commented 8 months ago

Did you check docs and existing issues?

Neovim Version (nvim -v)

NVIM v0.9.5

Operating System / Version

Chimera Linux

Describe the Bug

Here's the full output of nvim -v

$ nvim -v
NVIM v0.9.5
Build type: RelWithDebInfo
Lua 5.1
Compilation: /usr/lib/ccache/bin/clang -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_VENDOR_BIT -I/usr/include/lua5.1 -I/usr/include -I/usr/include -I/builddir/neovim-0.9.5/build/src/nvim/auto -I/builddir/neovim-0.9.5/build/include -I/builddir/neovim-0.9.5/build/cmake.config -I/builddir/neovim-0.9.5/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Do note the absence of LuaJIT.
That's also the reason I used packer.nvim for the minimal config below (since lazy.nvim requires LuaJIT)

Screenshots, Traceback

E5108: Error executing lua ...m.full/site/pack/packer/start/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:431: '=' expected near 'continue'
stack traceback:
        [C]: in function 'error'
        ?: in function <?:15>
        [C]: in function 'require'
        ...nvim/lua/neo-tree/sources/filesystem/lib/fs_scan.lua:4: in main chunk
        [C]: in function 'require'
        ...start/neo-tree.nvim/lua/neo-tree/sources/manager.lua:6: in main chunk
        [C]: in function 'require'
        ...er/start/neo-tree.nvim/lua/neo-tree/command/init.lua:3: in main chunk
        [C]: in function 'require'
        [string ":lua"]:1: in main chunk

Steps to Reproduce

  1. Populate init.lua with the config given below
  2. :Neotree

Expected Behavior

No errors.

Your Configuration

-- require'plugins'
local ensure_packer = function()
  local fn = vim.fn
  local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
  if fn.empty(fn.glob(install_path)) > 0 then
    fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
    vim.cmd [[packadd packer.nvim]]
    return true
  end
  return false
end

local packer_bootstrap = ensure_packer()

return require('packer').startup(function(use)
  use 'wbthomason/packer.nvim'
  use {
  "nvim-neo-tree/neo-tree.nvim",
    branch = "v3.x",
    requires = {
      "nvim-lua/plenary.nvim",
      "MunifTanjim/nui.nvim",
    }
  }
  if packer_bootstrap then
    require('packer').sync()
  end
end)
bwpge commented 8 months ago

I think before addressing this we would need guidance from the plugin maintainers if Lua 5.1 is supported. There are some ugly workarounds to avoid a goto (see: https://stackoverflow.com/a/13825260), but I'm not sure what other compatibility problems are lurking since I don't have access to Neovim without LuaJIT.

pysan3 commented 8 months ago

Wow, is it even possible to run neovim without luajit (with enough speed)??

Iirc there are 2 places in the code that uses the goto::continue feature, just for the sake of cleaner code (or nested if-else gets so much indented).

I'm doing a complete rewrite now, and in the newer code, I deleted all goto's.

Please wait till that's finished (which will take very long tho), or please submit a PR yourself as the core maintainers all use luajit and have no time to do the refactoring.

@cseickel could you make a v4 tag or a milestone so I can start tagging what issues I can/should iron out in my rewrite?

cseickel commented 8 months ago

@cseickel could you make a v4 tag or a milestone so I can start tagging what issues I can/should iron out in my rewrite?

I created a v4.0 milestone