aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gitstatus.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/gitstatus.lua b/plugins/gitstatus.lua
index 9a36142..04f6b15 100644
--- a/plugins/gitstatus.lua
+++ b/plugins/gitstatus.lua
@@ -7,11 +7,19 @@ local StatusView = require "core.statusview"
local TreeView = require "plugins.treeview"
config.plugins.gitstatus = common.merge({
+ color_icons = true,
recurse_submodules = true,
-- The config specification used by the settings gui
config_spec = {
name = "Git Status",
{
+ label = "Colorize icons",
+ description = "Colorize the icons as well",
+ path = "color_icons",
+ type = "toggle",
+ default = true
+ },
+ {
label = "Recurse Submodules",
description = "Also retrieve git stats from submodules.",
path = "recurse_submodules",
@@ -39,6 +47,15 @@ function TreeView:get_item_text(item, active, hovered)
return text, font, color
end
+-- Override TreeView's get_item_icon to add modification color
+local treeview_get_item_icon = TreeView.get_item_icon
+function TreeView:get_item_icon(item, active, hovered)
+ local character, font, color = treeview_get_item_icon(self, item, active, hovered)
+ if config.plugins.gitstatus and config.plugins.gitstatus.color_icons and cached_color_for_item[item.abs_filename] then
+ color = cached_color_for_item[item.abs_filename]
+ end
+ return character, font, color
+end
local git = {
branch = nil,