refactor(#2787): use inline deprecation disabling
This commit is contained in:
@@ -31,8 +31,7 @@ function M.change_root(path, bufnr)
|
||||
if vim.fn.has "nvim-0.10" == 1 then
|
||||
ft = vim.api.nvim_get_option_value("filetype", { buf = bufnr }) or ""
|
||||
else
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
ft = vim.api.nvim_buf_get_option(bufnr, "filetype") or ""
|
||||
ft = vim.api.nvim_buf_get_option(bufnr, "filetype") or "" ---@diagnostic disable-line: deprecated
|
||||
end
|
||||
|
||||
for _, value in pairs(_config.update_focused_file.update_root.ignore_list) do
|
||||
@@ -91,8 +90,7 @@ function M.tab_enter()
|
||||
if vim.fn.has "nvim-0.10" == 1 then
|
||||
ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) or ""
|
||||
else
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
ft = vim.api.nvim_buf_get_option(0, "ft")
|
||||
ft = vim.api.nvim_buf_get_option(0, "ft") ---@diagnostic disable-line: deprecated
|
||||
end
|
||||
|
||||
for _, filter in ipairs(M.config.tab.sync.ignore) do
|
||||
|
||||
@@ -177,8 +177,7 @@ local function open()
|
||||
if vim.fn.has "nvim-0.10" == 1 then
|
||||
vim.api.nvim_set_option_value("modifiable", false, { buf = M.bufnr })
|
||||
else
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
vim.api.nvim_buf_set_option(M.bufnr, "modifiable", false)
|
||||
vim.api.nvim_buf_set_option(M.bufnr, "modifiable", false) ---@diagnostic disable-line: deprecated
|
||||
end
|
||||
|
||||
-- highlight it
|
||||
|
||||
@@ -85,8 +85,7 @@ function M.get_last_group_node(node)
|
||||
node = node.group_next
|
||||
end
|
||||
|
||||
---@diagnostic disable-next-line: return-type-mismatch -- it can't be nil
|
||||
return node
|
||||
return node ---@diagnostic disable-line: return-type-mismatch -- it can't be nil
|
||||
end
|
||||
|
||||
---Group empty folders
|
||||
|
||||
@@ -154,8 +154,7 @@ local function create_overlay()
|
||||
if vim.fn.has "nvim-0.10" == 1 then
|
||||
vim.api.nvim_set_option_value("modifiable", true, { buf = overlay_bufnr })
|
||||
else
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
vim.api.nvim_buf_set_option(overlay_bufnr, "modifiable", true)
|
||||
vim.api.nvim_buf_set_option(overlay_bufnr, "modifiable", true) ---@diagnostic disable-line: deprecated
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_set_lines(overlay_bufnr, 0, -1, false, { M.filter })
|
||||
|
||||
@@ -22,8 +22,7 @@ local function _draw(bufnr, lines, hl_args, signs)
|
||||
if vim.fn.has "nvim-0.10" == 1 then
|
||||
vim.api.nvim_set_option_value("modifiable", true, { buf = bufnr })
|
||||
else
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
vim.api.nvim_buf_set_option(bufnr, "modifiable", true)
|
||||
vim.api.nvim_buf_set_option(bufnr, "modifiable", true) ---@diagnostic disable-line: deprecated
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines)
|
||||
@@ -32,8 +31,7 @@ local function _draw(bufnr, lines, hl_args, signs)
|
||||
if vim.fn.has "nvim-0.10" == 1 then
|
||||
vim.api.nvim_set_option_value("modifiable", false, { buf = bufnr })
|
||||
else
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
vim.api.nvim_buf_set_option(bufnr, "modifiable", false)
|
||||
vim.api.nvim_buf_set_option(bufnr, "modifiable", false) ---@diagnostic disable-line: deprecated
|
||||
end
|
||||
|
||||
vim.fn.sign_unplace(SIGN_GROUP)
|
||||
|
||||
Reference in New Issue
Block a user