Update from deprecated to modern functions

This commit is contained in:
Martin Larsson 2025-02-24 14:28:25 +00:00
parent 9dd59b2b0f
commit 3319ead7e7
2 changed files with 4 additions and 4 deletions

View file

@ -83,11 +83,11 @@ function M.add_opts_to_all_mappings(mappings, opts)
end end
function M.is_buf_filetype(bufnr, filetype) function M.is_buf_filetype(bufnr, filetype)
return vim.api.nvim_buf_get_option(bufnr, "filetype") == filetype return vim.api.nvim_get_option_value("filetype", { buf = bufnr }) == filetype
end end
function M.is_buf_buftype(bufnr, filetype) function M.is_buf_buftype(bufnr, buftype)
return vim.api.nvim_buf_get_option(bufnr, "buftype") == filetype return vim.api.nvim_get_option_value("buftype", { buf = bufnr }) == buftype
end end
function M.lock_buf_to_window(win_id, bufnr, filetype) function M.lock_buf_to_window(win_id, bufnr, filetype)

View file

@ -26,7 +26,7 @@ local function window_has_valid_buffer(window)
return false return false
end end
local buf_type = vim.api.nvim_buf_get_option(buf, "buftype") local buf_type = vim.api.nvim_get_option_value("buftype", { buf = buf })
if buf_type ~= "" then if buf_type ~= "" then
return false return false
end end