akinsho / akinsho/bufferline.nvim

[Bug]: Weird interaction with oil.nvim

オープン
#978 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Lua
スター
4.4k
フォーク
240
PR マージ指標
30日以内にマージされた PR はありません

説明

### Is there an existing issue for this?

- [X] I have searched the existing issues

### What happened?

The issue is that when the bufferline.nvim diagnostics options is true, and there is one more than one buffer open, there is a massive slowdown to create/move/delete any file on oil buffer, i believe it is because bufferline tries to check if there is any diagnostic to show on the oil buffer, which causes the slowdown.

There is some more context on this reddit post that i made some time ago:
https://www.reddit.com/r/neovim/comments/1ge0lzp/comment/lu8q5p7/

This is my config on bufferline that i used when the error happened:

### What did you expect to happen?

The expected behaviour is that there is no diagnostic to be run on the oil buffer, maybe a options to pass on what filetype it shouldn't try to run the diagnostics on.

### Config

```lua
return {
-- This is what powers LazyVim's fancy-looking
-- tabs, which include filetype icons and close buttons.
{
'akinsho/bufferline.nvim',
event = 'BufAdd',
keys = {
{ 'bp', 'BufferLineTogglePin', desc = 'Toggle Pin' },
{ 'bP', 'BufferLineGroupClose ungrouped', desc = 'Delete Non-Pinned Buffers' },
{ 'bo', 'BufferLineCloseOthers', desc = 'Delete Other Buffers' },
{ 'br', 'BufferLineCloseRight', desc = 'Delete Buffers to the Right' },
{ 'bl', 'BufferLineCloseLeft', desc = 'Delete Buffers to the Left' },
{ '', 'BufferLineCyclePrev', desc = 'Prev Buffer' },
{ '', 'BufferLineCycleNext', desc = 'Next Buffer' },
{ '[b', 'BufferLineCyclePrev', desc = 'Prev Buffer' },
{ ']b', 'BufferLineCycleNext', desc = 'Next Buffer' },
{ '[B', 'BufferLineMovePrev', desc = 'Move buffer prev' },
{ ']B', 'BufferLineMoveNext', desc = 'Move buffer next' },
},
opts = {
options = {
diagnostics = 'nvim_lsp',
always_show_bufferline = false,
diagnostics_indicator = function(_, _, diag)
local icons = require('local-icons').diagnostics
local ret = (diag.error and icons.Error .. diag.error .. ' ' or '') .. (diag.warning and icons.Warn .. diag.warning or '')
return vim.trim(ret)
end,
offsets = {
{
filetype = 'neo-tree',
text = 'Neo-tree',
highlight = 'Directory',
text_align = 'left',
},
},
},
},
},
{
'stevearc/oil.nvim',
lazy = true,
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
delete_to_trash = true,
skip_confirm_for_simple_edits = true,
watch_for_changes = false,
view_options = {
show_hidden = true,
},
lsp_file_methods = {
enabled = false,
timeout_ms = 1,
-- autosave_changes = true,
},
keymaps = {
['gw'] = {
function()
require('oil').save(nil, nil)
end,
desc = 'Save Oil Buffer',
},
['sF'] = {
function()
require('telescope.builtin').find_files {
cwd = require('oil').get_current_dir(),
}
end,
mode = 'n',
nowait = true,
desc = 'Find files in the current oil directory',
},
[''] = 'actions.select',
},
},
-- config = function ()
-- require("oil").setup()
-- end,
keys = {
{ '-', 'Oil', desc = 'Open parent directory' },
{
'_',
function()
require('oil').toggle_float()
end,
desc = 'Open floating parent direc',
},
},
},
}
```

### Additional Information

_No response_

### commit

_No response_

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。