From b86844d3d3ed8937847df510a540214f2997e2d9 Mon Sep 17 00:00:00 2001 From: 27Onion Nebell Date: Sat, 12 Apr 2025 12:31:56 +0800 Subject: [PATCH] fix: replace deprecated API in doc --- README.md | 6 +++--- doc/outline.txt | 6 +++--- lua/outline/providers/markdown.lua | 2 +- lua/outline/providers/norg.lua | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 814d713..74d4358 100644 --- a/README.md +++ b/README.md @@ -918,7 +918,7 @@ symbols = { ```lua symbols = { 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, } @@ -1112,7 +1112,7 @@ and `icons` as fallback. ```lua symbols = { 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, } @@ -1152,7 +1152,7 @@ other filetypes. ```lua symbols = { 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 return "" end diff --git a/doc/outline.txt b/doc/outline.txt index 174d8f7..90c32b8 100644 --- a/doc/outline.txt +++ b/doc/outline.txt @@ -806,7 +806,7 @@ based on the filetype. >lua symbols = { 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, } @@ -1007,7 +1007,7 @@ DIFFERENT ICONS BASED ON FILETYPE ~ >lua symbols = { 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, } @@ -1048,7 +1048,7 @@ other filetypes. >lua symbols = { 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 return "" end diff --git a/lua/outline/providers/markdown.lua b/lua/outline/providers/markdown.lua index 3188c43..827b9d2 100644 --- a/lua/outline/providers/markdown.lua +++ b/lua/outline/providers/markdown.lua @@ -19,7 +19,7 @@ local M = { ---@param config table? ---@return boolean ft_is_markdown 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 for _, ft_check in ipairs(config.filetypes) do if ft_check == ft then diff --git a/lua/outline/providers/norg.lua b/lua/outline/providers/norg.lua index 5ad44d9..ef2d434 100644 --- a/lua/outline/providers/norg.lua +++ b/lua/outline/providers/norg.lua @@ -21,7 +21,7 @@ local M = { ---@param bufnr integer ---@param config table? 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 end