fix: replace deprecated API in doc

This commit is contained in:
27Onion Nebell
2025-04-12 12:31:56 +08:00
parent 1460136dd0
commit b86844d3d3
4 changed files with 8 additions and 8 deletions

View File

@@ -918,7 +918,7 @@ symbols = {
```lua ```lua
symbols = { symbols = {
icon_fetcher = function(kind, bufnr, symbol) icon_fetcher = function(kind, bufnr, symbol)
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft') local ft = vim.api.nvim_get_option_value('ft', { buf = bufnr })
-- ... -- ...
end, end,
} }
@@ -1112,7 +1112,7 @@ and `icons` as fallback.
```lua ```lua
symbols = { symbols = {
icon_fetcher = function(kind, bufnr) icon_fetcher = function(kind, bufnr)
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft') local ft = vim.api.nvim_get_option_value('ft', { buf = bufnr })
-- ... -- ...
end, end,
} }
@@ -1152,7 +1152,7 @@ other filetypes.
```lua ```lua
symbols = { symbols = {
icon_fetcher = function(k, buf) icon_fetcher = function(k, buf)
local ft = vim.api.nvim_buf_get_option(buf, "ft") local ft = vim.api.nvim_get_option_value("ft", { buf = buf })
if ft == 'markdown' then if ft == 'markdown' then
return "" return ""
end end

View File

@@ -806,7 +806,7 @@ based on the filetype.
>lua >lua
symbols = { symbols = {
icon_fetcher = function(kind, bufnr, symbol) icon_fetcher = function(kind, bufnr, symbol)
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft') local ft = vim.api.nvim_get_option_value('ft', { buf = bufnr })
-- ... -- ...
end, end,
} }
@@ -1007,7 +1007,7 @@ DIFFERENT ICONS BASED ON FILETYPE ~
>lua >lua
symbols = { symbols = {
icon_fetcher = function(kind, bufnr) icon_fetcher = function(kind, bufnr)
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft') local ft = vim.api.nvim_get_option_value('ft', { buf = bufnr })
-- ... -- ...
end, end,
} }
@@ -1048,7 +1048,7 @@ other filetypes.
>lua >lua
symbols = { symbols = {
icon_fetcher = function(k, buf) icon_fetcher = function(k, buf)
local ft = vim.api.nvim_buf_get_option(buf, "ft") local ft = vim.api.nvim_get_option_value("ft", { buf = buf })
if ft == 'markdown' then if ft == 'markdown' then
return "" return ""
end end

View File

@@ -19,7 +19,7 @@ local M = {
---@param config table? ---@param config table?
---@return boolean ft_is_markdown ---@return boolean ft_is_markdown
function M.supports_buffer(bufnr, config) function M.supports_buffer(bufnr, config)
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft') local ft = vim.api.nvim_get_option_value('ft', { buf = bufnr })
if config and config.filetypes then if config and config.filetypes then
for _, ft_check in ipairs(config.filetypes) do for _, ft_check in ipairs(config.filetypes) do
if ft_check == ft then if ft_check == ft then

View File

@@ -21,7 +21,7 @@ local M = {
---@param bufnr integer ---@param bufnr integer
---@param config table? ---@param config table?
function M.supports_buffer(bufnr, config) function M.supports_buffer(bufnr, config)
if vim.api.nvim_buf_get_option(bufnr, 'ft') ~= 'norg' then if vim.api.nvim_get_option_value('ft', { buf = bufnr }) ~= 'norg' then
return false return false
end end