Skip to content

Commit

Permalink
fix: use of deprecated vim.tbl_islist (#581)
Browse files Browse the repository at this point in the history
* fix: use of deprecated `vim.tbl_islist`

* chore: ensure `islist` is backward compatible
  • Loading branch information
weskoerber authored May 17, 2024
1 parent 5880baa commit 79f7d16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/barbar/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local del_autocmd = vim.api.nvim_del_autocmd --- @type function
local exec_autocmds = vim.api.nvim_exec_autocmds --- @type function
local get_current_tabpage = vim.api.nvim_get_current_tabpage
local get_option = vim.api.nvim_get_option --- @type function
local islist = vim.islist or vim.tbl_islist --- @type function
local on_key = vim.on_key
local replace_termcodes = vim.api.nvim_replace_termcodes
local schedule_wrap = vim.schedule_wrap
Expand Down Expand Up @@ -395,7 +396,7 @@ function events.enable()
]]

local g_bufferline = vim.g.bufferline
if type(g_bufferline) ~= 'table' or vim.tbl_islist(g_bufferline) then
if type(g_bufferline) ~= 'table' or islist(g_bufferline) then
vim.g.bufferline = vim.empty_dict()
end

Expand Down Expand Up @@ -474,7 +475,7 @@ do
--- @param k string
--- @param v any
function vim_g_metatable.__newindex(tbl, k, v)
if k == 'bufferline' and (type(v) ~= 'table' or vim.tbl_islist(v)) then
if k == 'bufferline' and (type(v) ~= 'table' or islist(v)) then
v = vim.empty_dict()
end

Expand Down

0 comments on commit 79f7d16

Please sign in to comment.