Add arrow, also, add arrow to the incline status line. TODO: Fix so arrow status line uses the incline window and not current buffer.
This commit is contained in:
parent
f6dee75d2c
commit
fa5dab7882
2 changed files with 24 additions and 3 deletions
7
nvim/lua/plugs/arrow.lua
Normal file
7
nvim/lua/plugs/arrow.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
return {
|
||||||
|
"otavioschwanck/arrow.nvim",
|
||||||
|
opts = {
|
||||||
|
show_icons = true,
|
||||||
|
leader_key = ","
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -40,7 +40,8 @@ return {
|
||||||
local label = {}
|
local label = {}
|
||||||
|
|
||||||
for severity, icon in pairs(icons) do
|
for severity, icon in pairs(icons) do
|
||||||
local n = #vim.diagnostic.get(props.buf, { severity = vim.diagnostic.severity[string.upper(severity)] })
|
local n = #vim.diagnostic.get(props.buf,
|
||||||
|
{ severity = vim.diagnostic.severity[string.upper(severity)] })
|
||||||
if n > 0 then
|
if n > 0 then
|
||||||
table.insert(label, { icon .. n .. " ", group = "DiagnosticSign" .. severity })
|
table.insert(label, { icon .. n .. " ", group = "DiagnosticSign" .. severity })
|
||||||
end
|
end
|
||||||
|
|
@ -51,6 +52,19 @@ return {
|
||||||
return label
|
return label
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO: Make this fetch data from arrow using the file that the statusline is running on.
|
||||||
|
-- This will require a pull request to change how it handles the statusline.
|
||||||
|
-- Right now it just uses the current buffer.
|
||||||
|
-- It can still be the same UX but with the option of sending in a path to work on.
|
||||||
|
local function get_arrow_label()
|
||||||
|
local statusline = require("arrow.statusline")
|
||||||
|
if statusline.is_on_arrow_file() == nil then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
|
return " " .. statusline.text_for_statusline_with_icons()
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
guibg = "#1e2030",
|
guibg = "#1e2030",
|
||||||
guifg = "#cad3f5",
|
guifg = "#cad3f5",
|
||||||
|
|
@ -58,8 +72,8 @@ return {
|
||||||
{ get_diagnostic_label() },
|
{ get_diagnostic_label() },
|
||||||
{ get_git_diff() },
|
{ get_git_diff() },
|
||||||
{ (ft_icon or "") .. " ", guifg = ft_color, guibg = "none" },
|
{ (ft_icon or "") .. " ", guifg = ft_color, guibg = "none" },
|
||||||
{ filename .. " ", gui = vim.bo[props.buf].modified and "bold,italic" or "bold" },
|
{ filename .. " ┊", gui = vim.bo[props.buf].modified and "bold,italic" or "bold" },
|
||||||
{ "┊ " .. vim.api.nvim_win_get_number(props.win), group = "DevIconWindows" },
|
{ get_arrow_label() .. " " .. vim.api.nvim_win_get_number(props.win), group = "DevIconWindows" },
|
||||||
{ " " }
|
{ " " }
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue