feat(renderer): add ability to set git icons in signcolumn (#1242)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
local _icons = require "nvim-tree.renderer.icon-config"
|
||||
local utils = require "nvim-tree.utils"
|
||||
|
||||
local M = {}
|
||||
local M = {
|
||||
SIGN_GROUP = "NvimTreeGitSigns",
|
||||
}
|
||||
|
||||
local function build_icons_table()
|
||||
local i = M.icon_state.icons.git_icons
|
||||
@@ -124,6 +126,17 @@ local git_hl = {
|
||||
[" A"] = "none",
|
||||
}
|
||||
|
||||
function M.setup_signs()
|
||||
local i = M.icon_state.icons.git_icons
|
||||
vim.fn.sign_define("NvimTreeGitDirty", { text = i.unstaged, texthl = "NvimTreeGitDirty" })
|
||||
vim.fn.sign_define("NvimTreeGitStaged", { text = i.staged, texthl = "NvimTreeGitStaged" })
|
||||
vim.fn.sign_define("NvimTreeGitMerge", { text = i.unmerged, texthl = "NvimTreeGitMerge" })
|
||||
vim.fn.sign_define("NvimTreeGitRenamed", { text = i.renamed, texthl = "NvimTreeGitRenamed" })
|
||||
vim.fn.sign_define("NvimTreeGitNew", { text = i.untracked, texthl = "NvimTreeGitNew" })
|
||||
vim.fn.sign_define("NvimTreeGitDeleted", { text = i.deleted, texthl = "NvimTreeGitDeleted" })
|
||||
vim.fn.sign_define("NvimTreeGitIgnored", { text = i.ignored, texthl = "NvimTreeGitIgnored" })
|
||||
end
|
||||
|
||||
local function get_highlight_(node)
|
||||
local git_status = node.git_status
|
||||
if not git_status then
|
||||
|
||||
Reference in New Issue
Block a user