romgrk / barbar.nvim

The neovim tabline plugin.
2.26k stars 85 forks source link

Error when executing vimgrep #489

Closed Bekaboo closed 1 year ago

Bekaboo commented 1 year ago

Description

Recently, every time when I try to execute a vimgrep (:vimgrep /<pattern>/ <files>), the following error occurs:

Error executing vim.schedule lua callback: ...e/pack/packages/opt/barbar.nvim/lua/b
arbar/jump_mode.lua:62: Invalid buffer id: 9
stack traceback:
        [C]: in function 'buf_get_name'
        ...e/pack/packages/opt/barbar.nvim/lua/barbar/jump_mode.lua:62: in function
 'assign_next_letter'
        ...site/pack/packages/opt/barbar.nvim/lua/barbar/events.lua:82: in function
 ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

To Reproduce

init.lua:

vim.cmd([[
    let $PLUGIN_DIRECTORY = '~/.local/share/nvim/site/pack/packages/opt/'
    set runtimepath^=$PLUGIN_DIRECTORY/nvim-web-devicons
    set runtimepath^=$PLUGIN_DIRECTORY/barbar.nvim
]])

require('bufferline').setup({})

Steps to reproduce the behavior:

  1. nvim -nu init.lua
  2. :vimg /vim/ *
  3. See the error

Screenshots image

Informations

Neovim version:

NVIM v0.10.0-dev-332+gedfa8d6f2f
Build type: Release
LuaJIT 2.1.0-beta3
Iron-E commented 1 year ago

I can reproduce and I'll work on a fix.

Unrelated, but is there a particular reason for using :vimgrep over :grep? :grep seems to work, even if &grepprg is set to "internal". (Just wanna know in case I'm missing out on a cool feature :smiley:)

Iron-E commented 1 year ago

Bisected to d71ec09a3efc773a9246ee86d51f5b63965a6315

Bekaboo commented 1 year ago

is there a particular reason for using :vimgrep over :grep

Mainly for using vim-flavored regular expression for searching -- I didn't know that :grep works like :vimgrep if 'grepprog' is set to "internal".

Bekaboo commented 1 year ago

Thanks for the quick fix!