From af3337879d13a38e78dae7b5d0f8f14075851b13 Mon Sep 17 00:00:00 2001 From: Alexandr Makurin Date: Mon, 31 Jan 2022 11:06:36 +0300 Subject: [PATCH] Fix git icons on files and folders in subfolders (#911) --- lua/nvim-tree/git/runner.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/nvim-tree/git/runner.lua b/lua/nvim-tree/git/runner.lua index 0c2d7726..45830bdd 100644 --- a/lua/nvim-tree/git/runner.lua +++ b/lua/nvim-tree/git/runner.lua @@ -8,6 +8,10 @@ function Runner:_parse_status_output(line) local status = line:sub(1, 2) -- removing `"` when git is returning special file status containing spaces local path = line:sub(4, -2):gsub('^"', ''):gsub('"$', '') + -- replacing slashes if on windows + if vim.fn.has('win32') == 1 then + path = path:gsub('/', '\\') + end if #status > 0 and #path > 0 then self.output[utils.path_remove_trailing(utils.path_join({self.project_root,path}))] = status end