Skip to content

Commit 2355fe9

Browse files
committed
chore: add doc in vim doc, rename toggle_all_off -> disable_all
1 parent dc709b4 commit 2355fe9

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

doc/nvim-tree-lua.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,4 +774,35 @@ on_folder_removed({handler})
774774
{handler} (function) Handler function, with the
775775
signature `function(payload)`.
776776

777+
==============================================================================
778+
MARKS *nvim-tree-marks*
779+
780+
|nvim-tree.marks| *nvim-tree.marks*
781+
782+
You can toggle marks on file/folders to batch a function on multiple
783+
nodes with the `marks` module.
784+
785+
>
786+
local nvim_tree_marks = require "nvim-tree.marks"
787+
local marks = nvim_tree_marks.get_marks()
788+
<
789+
790+
toggle_mark() *nvim-tree.marks.toggle_mark()*
791+
792+
Toggle a mark on a file or folder under the cursor.
793+
Mapped to `m` by default.
794+
795+
get_marks() *nvim-tree.marks.get_marks()*
796+
797+
Get the list of current marked files/folders.
798+
Returns a list of nodes.
799+
800+
disable_all() *nvim-tree.marks.disable_all()*
801+
802+
Remove all marks currently enabled.
803+
Mapped to `M` by default.
804+
805+
You can highlight |NvimTreeMarkedFile| to override the default highlight
806+
for files and folders with marks.
807+
777808
vim:tw=78:ts=8:noet:ft=help:norl:

lua/nvim-tree/marks.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ local function iterate_toggle_off(node)
4242
end
4343
end
4444

45-
function M.toggle_all_off()
45+
function M.disable_all()
4646
iterate_toggle_off(lib.Tree)
4747
if view.win_open() then
4848
renderer.draw(lib.Tree, true)

lua/nvim-tree/view.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ M.View = {
7777
{ key = "q", cb = M.nvim_tree_callback("close") },
7878
{ key = "g?", cb = M.nvim_tree_callback("toggle_help") },
7979
{ key = 'm', cb = ":lua require'nvim-tree.marks'.toggle_mark()<cr>" },
80-
{ key = 'M', cb = ":lua require'nvim-tree.marks'.toggle_all_off()<cr>" },
80+
{ key = 'M', cb = ":lua require'nvim-tree.marks'.disable_all()<cr>" },
8181
}
8282
}
8383

0 commit comments

Comments
 (0)