aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Minor <github@pixelverse.org>2021-11-20 23:09:02 -0800
committerJoshua Minor <github@pixelverse.org>2021-11-21 00:28:01 -0800
commit73faa10b4acc18228accfcf20e22d36228eb0cb3 (patch)
treefaa318e19f80c7b6b49f04f8288da0fecda47f74
parent5fe0ad00084c8caaeda8a2c9bcb82da32fdf3a86 (diff)
downloadlite-xl-plugins-73faa10b4acc18228accfcf20e22d36228eb0cb3.tar.gz
lite-xl-plugins-73faa10b4acc18228accfcf20e22d36228eb0cb3.zip
Color every parent folder of each changed file.
-rw-r--r--plugins/gitstatus.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/gitstatus.lua b/plugins/gitstatus.lua
index eb925b0..54bd6e8 100644
--- a/plugins/gitstatus.lua
+++ b/plugins/gitstatus.lua
@@ -70,7 +70,13 @@ core.add_thread(function()
deletes = deletes + (tonumber(dels) or 0)
local abs_path = core.project_dir.."/"..root..path
if TreeView then
- TreeView:set_color_override(abs_path, style.gitstatus_modification)
+ -- Color this file, and each parent folder,
+ -- so you can see at a glance which folders
+ -- have modified files in them.
+ while abs_path do
+ TreeView:set_color_override(abs_path, style.gitstatus_modification)
+ abs_path = common.dirname(abs_path)
+ end
end
end
end