Skip to content

Commit

Permalink
fix(cookbook): migrate from nvim_buf_get_option to `nvim_get_option…
Browse files Browse the repository at this point in the history
  • Loading branch information
escwxyz committed Jan 26, 2024
1 parent 1b6f12e commit 512ff09
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -1926,18 +1926,18 @@ local TablineFileName = {
local TablineFileFlags = {
{
condition = function(self)
return vim.api.nvim_buf_get_option(self.bufnr, "modified")
return vim.api.nvim_get_option_value("modified", { buf = self.bufnr })
end,
provider = "[+]",
hl = { fg = "green" },
},
{
condition = function(self)
return not vim.api.nvim_buf_get_option(self.bufnr, "modifiable")
or vim.api.nvim_buf_get_option(self.bufnr, "readonly")
return not vim.api.nvim_get_option_value("modifiable", { buf = self.bufnr })
or vim.api.nvim_get_option_value("readonly", { buf = self.bufnr })
end,
provider = function(self)
if vim.api.nvim_buf_get_option(self.bufnr, "buftype") == "terminal" then
if vim.api.nvim_get_option_value("buftype", { buf = self.bufnr }) == "terminal" then
return ""
else
return ""
Expand Down Expand Up @@ -1986,7 +1986,7 @@ local TablineFileNameBlock = {
-- a nice "x" button to close the buffer
local TablineCloseButton = {
condition = function(self)
return not vim.api.nvim_buf_get_option(self.bufnr, "modified")
return not vim.api.nvim_get_option_value("modified", { buf = self.bufnr })
end,
{ provider = " " },
{
Expand Down Expand Up @@ -2031,7 +2031,7 @@ local BufferLine = utils.make_buflist(
-- this is the default function used to retrieve buffers
local get_bufs = function()
return vim.tbl_filter(function(bufnr)
return vim.api.nvim_buf_get_option(bufnr, "buflisted")
return vim.api.nvim_get_option_value("buflisted", { buf = bufnr })
end, vim.api.nvim_list_bufs())
end

Expand Down

0 comments on commit 512ff09

Please sign in to comment.