Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rebelot/heirline.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelot committed May 20, 2024
2 parents 2423ce2 + c52391d commit 7566440
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [1.0.3](https://github.com/rebelot/heirline.nvim/compare/v1.0.2...v1.0.3) (2024-02-12)


### Bug Fixes

* **cookbook:** migrate from `nvim_buf_get_option` to `nvim_get_option_value` ([512ff09](https://github.com/rebelot/heirline.nvim/commit/512ff096d427ade3ca11e18f7b0a6f1819095a45))

## [1.0.2](https://github.com/rebelot/heirline.nvim/compare/v1.0.1...v1.0.2) (2023-11-29)


### Bug Fixes

* **winbar:** don't modify winbar for disabled buffers ([7ee3553](https://github.com/rebelot/heirline.nvim/commit/7ee355330b9c6c3d4a43c6f22bc78364ea9acac7))

## [1.0.1](https://github.com/rebelot/heirline.nvim/compare/v1.0.0...v1.0.1) (2023-09-03)


Expand Down
25 changes: 12 additions & 13 deletions cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ are absolutely free to omit that if you're not an icon person.
```lua

local FileNameBlock = {
-- let's first set up some attributes needed by this component and it's children
-- let's first set up some attributes needed by this component and its children
init = function(self)
self.filename = vim.api.nvim_buf_get_name(0)
end,
Expand Down Expand Up @@ -730,7 +730,7 @@ Here's some classics!
https://user-images.githubusercontent.com/36300441/187189451-519e5d2b-115b-4f36-bfb3-7d4ec50bec05.mov

```lua
-- We're getting minimalists here!
-- We're getting minimalist here!
local Ruler = {
-- %l = current line number
-- %L = number of lines in the buffer
Expand All @@ -741,7 +741,7 @@ local Ruler = {
```

```lua
-- I take no credits for this! :lion:
-- I take no credits for this! 🦁
local ScrollBar ={
static = {
sbar = { '', '', '', '', '', '', '', '' }
Expand All @@ -760,13 +760,12 @@ local ScrollBar ={

### LSP

Nice work! You made it ~~jumped right~~ to the main courses! The finest rice is
Nice work! You ~~jumped right~~ made it to the main courses! The finest rice is
here.

<img width="398" alt="heirline_lsp" src="https://user-images.githubusercontent.com/36300441/187190679-b2860e44-cde6-484a-967e-3d48c479e471.png">

```lua

local LSPActive = {
condition = conditions.lsp_attached,
update = {'LspAttach', 'LspDetach'},
Expand All @@ -775,7 +774,7 @@ local LSPActive = {
-- provider = " [LSP]",

-- Or complicate things a bit and get the servers names
provider = function()
provider = function()
local names = {}
for i, server in pairs(vim.lsp.get_active_clients({ bufnr = 0 })) do
table.insert(names, server.name)
Expand Down Expand Up @@ -861,7 +860,7 @@ local Navic = {
dec = function(c)
local line = bit.rshift(c, 16)
local col = bit.band(bit.rshift(c, 6), 1023)
local winnr = bit.band(c, 63)
local winnr = bit.band(c, 63)
return line, col, winnr
end
},
Expand Down Expand Up @@ -1926,18 +1925,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 +1985,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 +2030,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 7566440

Please sign in to comment.