Skip to content

feat(api): add api.marks.clear #1708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/nvim-tree-lua.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,7 @@ exists.
- get
- list
- toggle
- clear
- bulk.move
- navigate.next
- navigate.prev
Expand Down
1 change: 1 addition & 0 deletions lua/nvim-tree/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Api.live_filter.clear = require("nvim-tree.live-filter").clear_filter
Api.marks.get = inject_node(require("nvim-tree.marks").get_mark)
Api.marks.list = require("nvim-tree.marks").get_marks
Api.marks.toggle = inject_node(require("nvim-tree.marks").toggle_mark)
Api.marks.clear = require("nvim-tree.marks").clear_marks
Api.marks.bulk.move = require("nvim-tree.marks.bulk-move").bulk_move
Api.marks.navigate.next = require("nvim-tree.marks.navigation").next
Api.marks.navigate.prev = require("nvim-tree.marks.navigation").prev
Expand Down
5 changes: 5 additions & 0 deletions lua/nvim-tree/marks/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ function M.toggle_mark(node)
end
end

function M.clear_marks()
NvimTreeMarks = {}
M.draw()
end

function M.get_mark(node)
return NvimTreeMarks[node.absolute_path]
end
Expand Down