feat(renderer): add ability to set git icons in signcolumn (#1242)

This commit is contained in:
Kiyan
2022-05-14 09:54:27 +02:00
committed by GitHub
parent 46014449b6
commit f8312cd06f
5 changed files with 42 additions and 11 deletions

View File

@@ -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