Skip to content

Commit 95092a1

Browse files
committed
refactor: clarify bookmark variable naming
1 parent 5757bcf commit 95092a1

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

lua/nvim-tree/explorer/filters.lua

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,23 +133,24 @@ function Filters:bookmark(path, path_type, bookmarks)
133133
end
134134

135135
local mark_parent = utils.path_add_trailing(path)
136-
for mark, mark_type in pairs(bookmarks) do
137-
if type(mark_type) == "table" and mark_type.type then
138-
mark_type = mark_type.type
136+
for bookmark_path, bookmark_entry in pairs(bookmarks) do
137+
local bookmark_type = bookmark_entry
138+
if type(bookmark_entry) == "table" and bookmark_entry.type then
139+
bookmark_type = bookmark_entry.type
139140
end
140-
if path == mark then
141+
if path == bookmark_path then
141142
return false
142143
end
143144

144145
if path_type == "directory" then
145146
-- check if path is mark's parent
146-
if vim.fn.stridx(mark, mark_parent) == 0 then
147+
if vim.fn.stridx(bookmark_path, mark_parent) == 0 then
147148
return false
148149
end
149150
end
150-
if mark_type == "directory" then
151+
if bookmark_type == "directory" then
151152
-- check if mark is path's parent
152-
local path_parent = utils.path_add_trailing(mark)
153+
local path_parent = utils.path_add_trailing(bookmark_path)
153154
if vim.fn.stridx(path, path_parent) == 0 then
154155
return false
155156
end

0 commit comments

Comments
 (0)