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

Getting error message after latest update 'Error detected while processing BufEnter Autocommands for "*":' #50

Closed
thekaganugur opened this issue Oct 19, 2021 · 3 comments

Comments

@thekaganugur
Copy link

I started to get error when I enter lir, I can proceed to use it but error pops out every time I use lir.nvim.

Here is the message:

Error detected while processing BufEnter Autocommands for "*":
E5108: Error executing lua ...l/share/nvim/site/pack/packer/start/lir.nvim/lua/lir.lua:243: Vim(lua):E5108: Error executing lua ...ck/packer
/start/lir.nvim/lua/lir/float/curdir_window.lua:113: attempt to index field 'curdir_window' (a nil value)

Thank you.

@tamago324
Copy link
Owner

Thanks for the report.
However, it seems to be working fine in my environment.

minvimrc
set encoding=utf-8

filetype plugin indent on
if has('vim_starting')
  let s:pluin_manager_dir='~/.config/nvim/.plugged/vim-plug'
  execute 'set runtimepath+=' . s:pluin_manager_dir
endif
call plug#begin('~/.config/nvim/.plugged')
Plug 'tamago324/lir.nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'nvim-lua/plenary.nvim'
call plug#end()

set nobackup
set nowritebackup
set noswapfile
set updatecount=0
set backspace=indent,eol,start
language messages en_US.utf8

lua << EOF

local actions = require'lir.actions'

require'lir'.setup {
  show_hidden_files = false,
  devicons_enable = true,
  mappings = {
    ['l']     = actions.edit,
    ['h']     = actions.up,
    ['q']     = actions.quit,
  },
  float = {
    winblend = 0,
    curdir_window = {
      enable = true,
      highlight_dirname = true,
    },

    -- You can define a function that returns a table to be passed as the third
    -- argument of nvim_open_win().
    win_opts = function()
      local width = math.floor(vim.o.columns * 0.5)
      local height = math.floor(vim.o.lines * 0.5)

      return {
        border = 'single',
        -- border = require("lir.float.helper").make_border_opts({
        --   "+",
        --   "",
        --   "+",
        --   "",
        --   "+",
        --   "",
        --   "+",
        --   "",
        -- }, "Normal"),
        width = width,
        height = height,
      }
    end,
  },
  hide_cursor = true,
}

vim.cmd [[augroup lir-settings]]
vim.cmd [[  autocmd!]]
vim.cmd [[  autocmd Filetype lir :lua LirSettings()]]
vim.cmd [[augroup END]]

vim.api.nvim_set_keymap(
  "n",
  "<C-e>",
  "<Cmd>lua require'lir.float'.toggle()<CR>",
  { silent = true, noremap = true }
)
EOF

Could you please update it again?

@thekaganugur
Copy link
Author

Hi, I had float = {} in my require'lir'.setup { } after deleting that line lirstarted working againg.

I was using commit commit = '5a7b21b0fdafe73719902b9848880fb3eb8500aa' in the meanwhile. Sorry for not communicating with you I was very busy.

@tamago324
Copy link
Owner

Thanks for the info!
We have just corrected the problem.

Don't worry, I can be slow to reply too.

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