mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
fix(bufferline): correctly configure bufferline to use the new bufremove util
This commit is contained in:
parent
289c2f81c4
commit
2e1c945f61
2 changed files with 6 additions and 4 deletions
|
@ -71,9 +71,9 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
close_command = function(n) require("mini.bufremove").delete(n, false) end,
|
close_command = function(n) LazyVim.ui.bufremove(n) end,
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end,
|
right_mouse_command = function(n) LazyVim.ui.bufremove(n) end,
|
||||||
diagnostics = "nvim_lsp",
|
diagnostics = "nvim_lsp",
|
||||||
always_show_bufferline = false,
|
always_show_bufferline = false,
|
||||||
diagnostics_indicator = function(_, _, diag)
|
diagnostics_indicator = function(_, _, diag)
|
||||||
|
|
|
@ -208,8 +208,10 @@ function M.foldexpr()
|
||||||
return "0"
|
return "0"
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.bufremove()
|
---@param buf number?
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
function M.bufremove(buf)
|
||||||
|
buf = buf or 0
|
||||||
|
buf = buf == 0 and vim.api.nvim_get_current_buf() or buf
|
||||||
|
|
||||||
if vim.bo.modified then
|
if vim.bo.modified then
|
||||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue