Skip to content

Commit

Permalink
Add settings for highlight colors (#7)
Browse files Browse the repository at this point in the history
Thank you to @ColinKennedy for the suggestion!
  • Loading branch information
will-lynas authored Jul 20, 2024
2 parents 980f10a + a023c62 commit 19b414d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ _Here `grapple-line.nvim` is used on the right of the tabline._
},
opts = {
number_of_files = 4,
colors = {
active = "lualine_a_normal",
inactive = "lualine_a_inactive",
},
},
}
```
Expand Down
11 changes: 6 additions & 5 deletions lua/grapple-line.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ local M = {}

M.settings = {
number_of_files = 4,
colors = {
active = "lualine_a_normal",
inactive = "lualine_a_inactive",
},
}

function M.setup(user_settings)
Expand All @@ -28,11 +32,8 @@ end
local function make_statusline(files)
local result = {}
for _, file in ipairs(files) do
if file.current then
table.insert(result, "%#lualine_a_normal# " .. file.name .. " %*")
else
table.insert(result, "%#lualine_a_inactive# " .. file.name .. " %*")
end
local color = file.current and M.settings.colors.active or M.settings.colors.inactive
table.insert(result, "%#" .. color .. "# " .. file.name .. " %*")
end
return table.concat(result)
end
Expand Down

0 comments on commit 19b414d

Please sign in to comment.