Skip to content

Commit d65dabb

Browse files
committed
refactor: rename marks config to bookmarks and simplify persistence API
- Rename opts.marks to opts.bookmarks for better clarity - Simplify persist option to boolean | string (true uses default path) - Implement lazy node resolution for loaded bookmarks - Update documentation with new bookmarks configuration - Improve bulk operations to use public list() method consistently
1 parent c7dd016 commit d65dabb

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

doc/nvim-tree-lua.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,9 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
640640
default_yes = false,
641641
},
642642
},
643+
bookmarks = {
644+
persist = false,
645+
},
643646
experimental = {
644647
},
645648
log = {
@@ -3200,6 +3203,7 @@ highlight group is not, hard linking as follows: >
32003203
|nvim-tree.actions.remove_file.close_window|
32013204
|nvim-tree.actions.use_system_clipboard|
32023205
|nvim-tree.auto_reload_on_write|
3206+
|nvim-tree.bookmarks.persist|
32033207
|nvim-tree.diagnostics.debounce_delay|
32043208
|nvim-tree.diagnostics.diagnostic_opts|
32053209
|nvim-tree.diagnostics.enable|

lua/nvim-tree/marks/init.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ function Marks:get(node)
127127
if not node or not node.absolute_path then
128128
return nil
129129
end
130-
131130
local mark = self.marks[node.absolute_path]
132131
if mark == true then
133132
-- Lazy resolve: try to find node in explorer tree
@@ -139,7 +138,6 @@ function Marks:get(node)
139138
end
140139
return nil
141140
end
142-
143141
return mark
144142
end
145143

@@ -162,7 +160,6 @@ function Marks:list()
162160
-- Already a node object
163161
node = mark
164162
end
165-
166163
if node then
167164
table.insert(list, node)
168165
end
@@ -359,7 +356,6 @@ function Marks:navigate_select()
359356
else
360357
node = mark
361358
end
362-
363359
if node and not node:is(DirectoryNode) and not utils.get_win_buf_from_path(node.absolute_path) then
364360
open_file.fn("edit", node.absolute_path)
365361
elseif node then

0 commit comments

Comments
 (0)