Skip to content

Commit ac9424a

Browse files
committed
docs(#3088): remove completed legacy api.lua members
1 parent 8169547 commit ac9424a

2 files changed

Lines changed: 34 additions & 23 deletions

File tree

doc/nvim-tree-lua.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2922,16 +2922,16 @@ bulk.trash() *nvim_tree.api.marks.bulk.trash()*
29222922
Delete all marked, prompting if |nvim_tree.Config.UI.Confirm| {trash}
29232923

29242924
clear() *nvim_tree.api.marks.clear()*
2925-
Clear all bookmarks.
2925+
Clear all marks.
29262926

29272927
get() *nvim_tree.api.marks.get()*
2928-
Return the node if it is bookmarked.
2928+
Return the node if it is marked.
29292929

29302930
Return: ~
29312931
(`nvim_tree.api.Node?`)
29322932

29332933
list() *nvim_tree.api.marks.list()*
2934-
Retrieve all bookmarked nodes.
2934+
Retrieve all marked nodes.
29352935

29362936
Return: ~
29372937
(`nvim_tree.api.Node[]`)
@@ -2947,7 +2947,7 @@ navigate.select() *nvim_tree.api.marks.navigate.select()*
29472947
will be focused, a file will be opened.
29482948

29492949
toggle({node}) *nvim_tree.api.marks.toggle()*
2950-
Toggle bookmark.
2950+
Toggle mark.
29512951

29522952
Parameters: ~
29532953
{node} (`nvim_tree.api.Node`) file or directory

lua/nvim-tree/api.lua

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ local RootNode = require("nvim-tree.node.root")
1515
local UserDecorator = require("nvim-tree.renderer.decorator.user")
1616

1717
local Api = {
18-
tree = {},
18+
-- tree = {},
1919
node = {
2020
navigate = {
2121
sibling = {},
@@ -28,20 +28,20 @@ local Api = {
2828
buffer = {},
2929
},
3030
events = {},
31-
marks = {
32-
bulk = {},
33-
navigate = {},
34-
},
31+
-- marks = {
32+
-- bulk = {},
33+
-- navigate = {},
34+
-- },
3535
fs = {
3636
copy = {},
3737
},
38-
git = {},
39-
live_filter = {},
40-
config = {
41-
mappings = {},
42-
},
38+
-- git = {},
39+
-- live_filter = {},
40+
-- config = {
41+
-- mappings = {},
42+
-- },
4343
commands = {},
44-
diagnostics = {},-- 1 collides with Config.Diagnostics - api.health
44+
-- diagnostics = {},
4545
decorator = {},
4646
}
4747

@@ -226,7 +226,9 @@ Api.tree.winid = wrap(view.winid)
226226
Api.tree.reload_git = wrap_explorer("reload_git")
227227

228228
-- TODO #3088 legacy mappings have to go somewhere
229-
Api.git.reload = Api.tree.reload_git
229+
Api.git = {
230+
reload = Api.tree.reload_git
231+
}
230232

231233
end
232234

@@ -350,7 +352,7 @@ Api.node.buffer.wipe = wrap_node(function(node, opts)
350352
actions.node.buffer.wipe(node, opts)
351353
end)
352354

353-
Api.git.reload = wrap_explorer("reload_git")
355+
-- Api.git.reload = wrap_explorer("reload_git")
354356

355357
Api.events.subscribe = events.subscribe
356358
Api.events.Event = events.Event
@@ -362,8 +364,10 @@ Api.filter.live_filter.start = wrap_explorer_member("live_filter", "start_filter
362364
Api.filter.live_filter.clear = wrap_explorer_member("live_filter", "clear_filter")
363365

364366
-- TODO #3088 legacy mappings have to go somewhere
365-
Api.live_filter.start = filter.live_filter.start
366-
Api.live_filter.clear = filter.live_filter.clear
367+
Api.live_filter = {
368+
start = filter.live_filter.start,
369+
clear = filter.live_filter.clear,
370+
}
367371

368372
end
369373

@@ -391,9 +395,13 @@ Api.map.get_keymap_default = wrap(keymap.get_keymap_default)
391395
Api.map.default_on_attach = keymap.default_on_attach
392396

393397
-- TODO #3088 legacy mappings have to go somewhere
394-
Api.config.mappings.get_keymap = Api.map.get_keymap
395-
Api.config.mappings.get_keymap_default = Api.map.get_keymap_default
396-
Api.config.mappings.default_on_attach = Api.map.default_on_attach
398+
Api.config = {
399+
mappings = {
400+
get_keymap = Api.map.get_keymap,
401+
get_keymap_default = Api.map.get_keymap_default,
402+
default_on_attach = Api.map.default_on_attach,
403+
}
404+
}
397405

398406
end
399407

@@ -403,7 +411,10 @@ function Api.hydrate_health(health)
403411
Api.health.hi_test = wrap(appearance_hi_test)
404412

405413
-- TODO #3088 legacy mappings have to go somewhere
406-
Api.diagnostics.hi_test = Api.health.hi_test
414+
Api.diagnostics = {
415+
hi_test = Api.health.hi_test,
416+
}
417+
407418
end
408419

409420
Api.commands.get = wrap(function()

0 commit comments

Comments
 (0)