@@ -12,12 +12,12 @@ local DirectoryNode = require("nvim-tree.node.directory")
1212--- @alias GitStatusStrings " deleted" | " ignored" | " renamed" | " staged" | " unmerged" | " unstaged" | " untracked"
1313
1414--- @alias GitIconsByStatus table<GitStatusStrings , GitHighlightedString> human status
15- --- @alias GitIconsByXY table<string , GitHighlightedString[]> porcelain status
16- --- @alias GitGlyphs table<GitStatusStrings , string> from opts
15+ --- @alias GitIconsByXY table<GitXY , GitHighlightedString[]> porcelain status
16+ --- @alias GitGlyphsByStatus table<GitStatusStrings , string> from opts
1717
1818--- @class (exact ) DecoratorGit : Decorator
19- --- @field file_hl_by_xy table<string , string> ?
20- --- @field folder_hl_by_xy table<string , string> ?
19+ --- @field file_hl_by_xy table<GitXY , string> ?
20+ --- @field folder_hl_by_xy table<GitXY , string> ?
2121--- @field icons_by_status GitIconsByStatus ?
2222--- @field icons_by_xy GitIconsByXY ?
2323local DecoratorGit = Decorator :new ()
@@ -56,7 +56,7 @@ function DecoratorGit:create(opts, explorer)
5656 return o
5757end
5858
59- --- @param glyphs GitGlyphs
59+ --- @param glyphs GitGlyphsByStatus
6060function DecoratorGit :build_icons_by_status (glyphs )
6161 self .icons_by_status = {}
6262 self .icons_by_status .staged = { str = glyphs .staged , hl = { " NvimTreeGitStagedIcon" }, ord = 1 }
@@ -154,19 +154,19 @@ function DecoratorGit:calculate_icons(node)
154154 return nil
155155 end
156156
157- local git_status = node :get_git_status ()
158- if git_status == nil then
157+ local git_xy = node :get_git_xy ()
158+ if git_xy == nil then
159159 return nil
160160 end
161161
162162 local inserted = {}
163163 local iconss = {}
164164
165- for _ , s in pairs (git_status ) do
165+ for _ , s in pairs (git_xy ) do
166166 local icons = self .icons_by_xy [s ]
167167 if not icons then
168168 if self .hl_pos == HL_POSITION .none then
169- notify .warn (string.format (" Unrecognized git state '%s'" , git_status ))
169+ notify .warn (string.format (" Unrecognized git state '%s'" , git_xy ))
170170 end
171171 return nil
172172 end
@@ -215,15 +215,15 @@ function DecoratorGit:calculate_highlight(node)
215215 return nil
216216 end
217217
218- local git_status = node :get_git_status ()
219- if not git_status then
218+ local git_xy = node :get_git_xy ()
219+ if not git_xy then
220220 return nil
221221 end
222222
223223 if node :is (DirectoryNode ) then
224- return self .folder_hl_by_xy [git_status [1 ]]
224+ return self .folder_hl_by_xy [git_xy [1 ]]
225225 else
226- return self .file_hl_by_xy [git_status [1 ]]
226+ return self .file_hl_by_xy [git_xy [1 ]]
227227 end
228228end
229229
0 commit comments