Skip to content

Commit

Permalink
fix(bufferline): use BufDel %d instead of bdelete! %d (ayamir#1136)
Browse files Browse the repository at this point in the history
* Use BufDel instead of bdelete! %d

When I use the close button on bufferline, it often exits abnormally.
After using BufDel instead of bdelete! %d, this situation no longer occurs.

Signed-off-by: Cyberczy <109653523+Cyberczy@users.noreply.github.com>

* Use BufDel %d instead of bdelete! %d

Signed-off-by: Cyberczy <109653523+Cyberczy@users.noreply.github.com>

---------

Signed-off-by: Cyberczy <109653523+Cyberczy@users.noreply.github.com>
  • Loading branch information
Cyberczy authored and Vincent Wang committed Jan 9, 2024
1 parent 15e88f2 commit 699031c
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions lua/modules/configs/ui/bufferline.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
return function()
local icons = { ui = require("modules.utils.icons").get("ui") }

<<<<<<< HEAD
local opts = {
options = {
number = nil,
Expand Down Expand Up @@ -43,6 +44,95 @@ return function()
-- Note: If you use catppuccin then modify the colors below!
highlights = {},
}
||||||| parent of 5f567d4 (fix(bufferline): use `BufDel %d` instead of `bdelete! %d` (#1136))
local opts = {
options = {
number = nil,
modified_icon = icons.ui.Modified,
buffer_close_icon = icons.ui.Close,
left_trunc_marker = icons.ui.Left,
right_trunc_marker = icons.ui.Right,
max_name_length = 20,
max_prefix_length = 13,
tab_size = 20,
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
show_tab_indicators = true,
enforce_regular_tabs = false,
persist_buffer_sort = true,
always_show_bufferline = true,
separator_style = "thin",
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count)
return "(" .. count .. ")"
end,
offsets = {
{
filetype = "NvimTree",
text = "File Explorer",
text_align = "center",
padding = 0,
},
{
filetype = "aerial",
text = "Symbol Outline",
text_align = "center",
padding = 0,
},
},
},
-- Change bufferline's highlights here! See `:h bufferline-highlights` for detailed explanation.
-- Note: If you use catppuccin then modify the colors below!
highlights = {},
}
=======
local opts = {
options = {
number = nil,
close_command = "BufDel %d",
right_mouse_command = "BufDel %d",
modified_icon = icons.ui.Modified,
buffer_close_icon = icons.ui.Close,
left_trunc_marker = icons.ui.Left,
right_trunc_marker = icons.ui.Right,
max_name_length = 20,
max_prefix_length = 13,
tab_size = 20,
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
show_tab_indicators = true,
enforce_regular_tabs = false,
persist_buffer_sort = true,
always_show_bufferline = true,
separator_style = "thin",
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count)
return "(" .. count .. ")"
end,
offsets = {
{
filetype = "NvimTree",
text = "File Explorer",
text_align = "center",
padding = 0,
},
{
filetype = "aerial",
text = "Symbol Outline",
text_align = "center",
padding = 0,
},
},
},
-- Change bufferline's highlights here! See `:h bufferline-highlights` for detailed explanation.
-- Note: If you use catppuccin then modify the colors below!
highlights = {},
}
>>>>>>> 5f567d4 (fix(bufferline): use `BufDel %d` instead of `bdelete! %d` (#1136))

if vim.g.colors_name == "nord" then
local nord_hl_overwrite = {
Expand Down

0 comments on commit 699031c

Please sign in to comment.