tamago324 / lir.nvim

Neovim file explorer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: Error detected while processing BufEnter Autocommands for "*":

TheCalculus opened this issue · comments

got this output upon launching nvim (running nvim . in the terminal in a directory)

Error detected while processing BufEnter Autocommands for "*":
E5108: Error executing lua ...pack/packer/start/lir.nvim/lua/lir/smart_cursor/init.lua:49: E545: Missing colon
stack traceback:
        [C]: in function 'nvim_set_option'
        ...pack/packer/start/lir.nvim/lua/lir/smart_cursor/init.lua:49: in function '_hide'
        ...pack/packer/start/lir.nvim/lua/lir/smart_cursor/init.lua:61: in function 'init'
        ...l/share/nvim/site/pack/packer/start/lir.nvim/lua/lir.lua:214: in function 'init'
        [string ":lua"]:1: in main chunk

im using the default configuration in the README

image

What version of neovim?

What version of neovim?

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.1/share/nvim"

Run :checkhealth for more info

This did not happen with nvim.exe on Windows 11 NVIM 0.9.1.
What is your OS and terminal?
I checked using init.vim as follows
Can you confirm this using a minimal init.vim like the one above?

set encoding=utf-8
scriptencoding utf-8

syntax enable
filetype plugin indent on

set nocompatible

call plug#begin('$HOME/AppData/Local/nvim/plugged')

Plug 'tamago324/lir.nvim'
Plug 'nvim-lua/plenary.nvim'

call plug#end()


lua << EOF

local actions = require'lir.actions'
local mark_actions = require 'lir.mark.actions'
local clipboard_actions = require'lir.clipboard.actions'

require'lir'.setup {
  show_hidden_files = false,
  ignore = {}, -- { ".DS_Store", "node_modules" } etc.
  devicons = {
    enable = false,
    highlight_dirname = false
  },
  mappings = {
    ['l']     = actions.edit,
    ['<C-s>'] = actions.split,
    ['<C-v>'] = actions.vsplit,
    ['<C-t>'] = actions.tabedit,

    ['h']     = actions.up,
    ['q']     = actions.quit,

    ['K']     = actions.mkdir,
    ['N']     = actions.newfile,
    ['R']     = actions.rename,
    ['@']     = actions.cd,
    ['Y']     = actions.yank_path,
    ['.']     = actions.toggle_show_hidden,
    ['D']     = actions.delete,

    ['J'] = function()
      mark_actions.toggle_mark()
      vim.cmd('normal! j')
    end,
    ['C'] = clipboard_actions.copy,
    ['X'] = clipboard_actions.cut,
    ['P'] = clipboard_actions.paste,
  },
  float = {
    winblend = 0,
    curdir_window = {
      enable = false,
      highlight_dirname = false
    },
  },
  hide_cursor = true
}

vim.api.nvim_create_autocmd({'FileType'}, {
  pattern = {"lir"},
  callback = function()
    -- use visual mode
    vim.api.nvim_buf_set_keymap(
      0,
      "x",
      "J",
      ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>',
      { noremap = true, silent = true }
    )
  
    -- echo cwd
    vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {})
  end
})

EOF

os: macos ventura 13.4.1 (22F82)
(on an m1 chip)
terminal: iterm2

my init file is obviously slightly different:

installation (using packer), packer.lua

    use({
        'tamago324/lir.nvim',
        requires = { {'nvim-lua/plenary.nvim' } }
    })

setup of lir, lir_setup.lua

local actions = require'lir.actions'
local mark_actions = require 'lir.mark.actions'
local clipboard_actions = require'lir.clipboard.actions'

require'lir'.setup {
    show_hidden_files = false,
    ignore = {}, -- { ".DS_Store", "node_modules" } etc.
    devicons = {
        enable = false,
        highlight_dirname = false
    },
    mappings = {
        ['l']     = actions.edit,
        ['<C-s>'] = actions.split,
        ['<C-v>'] = actions.vsplit,
        ['<C-t>'] = actions.tabedit,

        ['h']     = actions.up,
        ['q']     = actions.quit,

        ['K']     = actions.mkdir,
        ['N']     = actions.newfile,
        ['R']     = actions.rename,
        ['@']     = actions.cd,
        ['Y']     = actions.yank_path,
        ['.']     = actions.toggle_show_hidden,
        ['D']     = actions.delete,

        ['J'] = function()
            mark_actions.toggle_mark()
            vim.cmd('normal! j')
        end,
        ['C'] = clipboard_actions.copy,
        ['X'] = clipboard_actions.cut,
        ['P'] = clipboard_actions.paste,
    },
    float = {
        winblend = 0,
        curdir_window = {
            enable = false,
            highlight_dirname = false
        },
    },
    hide_cursor = true
}

vim.api.nvim_create_autocmd({'FileType'}, {
    pattern = {"lir"},
    callback = function()
        -- use visual mode
        vim.api.nvim_buf_set_keymap(
        0,
        "x",
        "J",
        ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>',
        { noremap = true, silent = true }
        )

        -- echo cwd
        vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {})
    end
})

it is identical to the minimal config you provided

I don't have a Mac so I can't check it at hand, but could you please follow these steps?

  1. Clone the plugin
mkdir ~/temp
cd ~/temp
git clone https://github.com/tamago324/lir.nvim
git clone https://github.com/nvim-lua/plenary.nvim
  1. Create a minimal vimrc

~/temp/.min.vimrc

syntax enable
filetype plugin indent on
set termguicolors

set rtp+=~/temp/plenary.nvim
set rtp+=~/temp/lir.nvim

lua << EOF

local actions = require'lir.actions'
local mark_actions = require 'lir.mark.actions'
local clipboard_actions = require'lir.clipboard.actions'

require'lir'.setup {
  show_hidden_files = false,
  ignore = {}, -- { ".DS_Store", "node_modules" } etc.
  devicons = {
    enable = false,
    highlight_dirname = false
  },
  mappings = {
    ['l']     = actions.edit,
    ['<C-s>'] = actions.split,
    ['<C-v>'] = actions.vsplit,
    ['<C-t>'] = actions.tabedit,

    ['h']     = actions.up,
    ['q']     = actions.quit,

    ['K']     = actions.mkdir,
    ['N']     = actions.newfile,
    ['R']     = actions.rename,
    ['@']     = actions.cd,
    ['Y']     = actions.yank_path,
    ['.']     = actions.toggle_show_hidden,
    ['D']     = actions.delete,

    ['J'] = function()
      mark_actions.toggle_mark()
      vim.cmd('normal! j')
    end,
    ['C'] = clipboard_actions.copy,
    ['X'] = clipboard_actions.cut,
    ['P'] = clipboard_actions.paste,
  },
  float = {
    winblend = 0,
    curdir_window = {
      enable = false,
      highlight_dirname = false
    },
  },
  hide_cursor = true
}

vim.api.nvim_create_autocmd({'FileType'}, {
  pattern = {"lir"},
  callback = function()
    -- use visual mode
    vim.api.nvim_buf_set_keymap(
      0,
      "x",
      "J",
      ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>',
      { noremap = true, silent = true }
    )
  
    -- echo cwd
    vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {})
  end
})


EOF
  1. Start nvim
nvim -u ~/temp/.min.vimrc
  1. Open lir.nvim
:e .

DId this ever get resolved? im having the same issue....

Looks like when i set the hide_cursor to false, the issue went away. Seems like it has to do with that setting