diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 4a526e67a92..084d429169d 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -278,9 +278,9 @@ All commands execute public API. keep_buffers = true }) < -*:NvimTreeHiTest* |nvim_tree.api.health.hi_test()| >lua +*:NvimTreeHiTest* |nvim_tree.api.appearance.hi_test()| >lua - require("nvim-tree.api").health.hi_test() + require("nvim-tree.api").appearance.hi_test() < *:NvimTreeResize* |nvim_tree.api.tree.resize()| >lua @@ -903,7 +903,7 @@ Deprecated API with unchanged function signature: `api.config.mappings.get_keymap_default` |nvim_tree.api.map.keymap.default()| `api.config.mappings.default_on_attach` |nvim_tree.api.map.on_attach.default()| -`api.diagnostics.hi_test` |nvim_tree.api.health.hi_test()| +`api.diagnostics.hi_test` |nvim_tree.api.appearance.hi_test()| `api.live_filter.start` |nvim_tree.api.filter.live.start()| `api.live_filter.clear` |nvim_tree.api.filter.live.clear()| @@ -2287,12 +2287,12 @@ Please do not require or use modules other than `nvim-tree.api`, as internal modules will change without notice. The API is separated into multiple modules: +• |nvim-tree-api-appearance| • |nvim-tree-api-commands| • |nvim-tree-api-events| • |nvim-tree-api-filter| • |nvim-tree-api-fs| • |nvim-tree-api-git| -• |nvim-tree-api-health| • |nvim-tree-api-map| • |nvim-tree-api-marks| • |nvim-tree-api-node| @@ -2354,6 +2354,16 @@ e.g. the following are functionally identical: >lua +============================================================================== +API: appearance *nvim-tree-api-appearance* + +hi_test() *nvim_tree.api.appearance.hi_test()* + Open a new buffer displaying all nvim-tree highlight groups, their link + chain and concrete definition. + + Similar to `:so $VIMRUNTIME/syntax/hitest.vim` as per |:highlight| + + ============================================================================== API: commands *nvim-tree-api-commands* @@ -2530,16 +2540,6 @@ reload() *nvim_tree.api.git.reload()* Update the git status of the entire tree. -============================================================================== -API: health *nvim-tree-api-health* - -hi_test() *nvim_tree.api.health.hi_test()* - Open a new buffer displaying all nvim-tree highlight groups, their link - chain and concrete definition. - - Similar to `:so $VIMRUNTIME/syntax/hitest.vim` as per |:highlight| - - ============================================================================== API: map *nvim-tree-api-map* diff --git a/lua/nvim-tree/_meta/api/health.lua b/lua/nvim-tree/_meta/api/appearance.lua similarity index 60% rename from lua/nvim-tree/_meta/api/health.lua rename to lua/nvim-tree/_meta/api/appearance.lua index 088ae5076cd..89771fcc6dc 100644 --- a/lua/nvim-tree/_meta/api/health.lua +++ b/lua/nvim-tree/_meta/api/appearance.lua @@ -1,11 +1,11 @@ ---@meta -local nvim_tree = { api = { health = {} } } +local nvim_tree = { api = { appearance = {} } } --- ---Open a new buffer displaying all nvim-tree highlight groups, their link chain and concrete definition. --- ---Similar to `:so $VIMRUNTIME/syntax/hitest.vim` as per |:highlight| --- -function nvim_tree.api.health.hi_test() end +function nvim_tree.api.appearance.hi_test() end -return nvim_tree.api.health +return nvim_tree.api.appearance diff --git a/lua/nvim-tree/_meta/api/deprecated.lua b/lua/nvim-tree/_meta/api/deprecated.lua index f9f37852225..3bfe136162a 100644 --- a/lua/nvim-tree/_meta/api/deprecated.lua +++ b/lua/nvim-tree/_meta/api/deprecated.lua @@ -27,7 +27,7 @@ function nvim_tree.api.live_filter.clear() end nvim_tree.api.diagnostics = {} ----@deprecated use `nvim_tree.api.health.hi_test()` +---@deprecated use `nvim_tree.api.appearance.hi_test()` function nvim_tree.api.diagnostics.hi_test() end nvim_tree.api.decorator = {} diff --git a/lua/nvim-tree/api.lua b/lua/nvim-tree/api.lua index 81250fe5fca..b90a9e1a1e9 100644 --- a/lua/nvim-tree/api.lua +++ b/lua/nvim-tree/api.lua @@ -5,12 +5,12 @@ --- ---The API is separated into multiple modules: --- +---- [nvim-tree-api-appearance] ---- [nvim-tree-api-commands] ---- [nvim-tree-api-events] ---- [nvim-tree-api-filter] ---- [nvim-tree-api-fs] ---- [nvim-tree-api-git] ----- [nvim-tree-api-health] ---- [nvim-tree-api-map] ---- [nvim-tree-api-marks] ---- [nvim-tree-api-node] @@ -75,12 +75,12 @@ ---@class nvim_tree.api ---@nodoc local api = { + appearance = require("nvim-tree._meta.api.appearance"), commands = require("nvim-tree._meta.api.commands"), events = require("nvim-tree._meta.api.events"), filter = require("nvim-tree._meta.api.filter"), fs = require("nvim-tree._meta.api.fs"), git = require("nvim-tree._meta.api.git"), - health = require("nvim-tree._meta.api.health"), map = require("nvim-tree._meta.api.map"), marks = require("nvim-tree._meta.api.marks"), node = require("nvim-tree._meta.api.node"), diff --git a/lua/nvim-tree/api/impl/pre.lua b/lua/nvim-tree/api/impl/pre.lua index 489fb05649c..1191b906734 100644 --- a/lua/nvim-tree/api/impl/pre.lua +++ b/lua/nvim-tree/api/impl/pre.lua @@ -48,7 +48,7 @@ function M.hydrate(api) api.map.keymap.default = keymap.get_keymap_default -- lazy functions - api.health.hi_test = function() require("nvim-tree.appearance.hi-test")() end + api.appearance.hi_test = function() require("nvim-tree.appearance.hi-test")() end -- classes api.Decorator = Decorator:extend() diff --git a/lua/nvim-tree/commands.lua b/lua/nvim-tree/commands.lua index 1f788127aa9..c21871d973b 100644 --- a/lua/nvim-tree/commands.lua +++ b/lua/nvim-tree/commands.lua @@ -143,7 +143,7 @@ local CMDS = { desc = "nvim-tree: highlight test", }, command = function() - require("nvim-tree.api").health.hi_test() + require("nvim-tree.api").appearance.hi_test() end, }, } diff --git a/lua/nvim-tree/legacy.lua b/lua/nvim-tree/legacy.lua index 47495e0e609..81bb10217e1 100644 --- a/lua/nvim-tree/legacy.lua +++ b/lua/nvim-tree/legacy.lua @@ -174,7 +174,7 @@ function M.map_api(api) api.tree.toggle_no_bookmark_filter = api.filter.no_bookmark.toggle api.diagnostics = api.diagnostics or {} - api.diagnostics.hi_test = api.health.hi_test + api.diagnostics.hi_test = api.appearance.hi_test api.decorator.UserDecorator = api.Decorator end diff --git a/scripts/vimdoc_config.lua b/scripts/vimdoc_config.lua index 07d47eec2b8..56b63e93844 100644 --- a/scripts/vimdoc_config.lua +++ b/scripts/vimdoc_config.lua @@ -46,20 +46,19 @@ local srcs_config = { ---@type Src[] local srcs_api = { - { helptag = "nvim-tree-api", section = "API", path = base .. "api.lua", }, - - { helptag = "nvim-tree-api-commands", section = "API: commands", path = base .. "_meta/api/commands.lua", }, - { helptag = "nvim-tree-api-events", section = "API: events", path = base .. "_meta/api/events.lua", }, - { helptag = "nvim-tree-api-filter", section = "API: filter", path = base .. "_meta/api/filter.lua", }, - { helptag = "nvim-tree-api-fs", section = "API: fs", path = base .. "_meta/api/fs.lua", }, - { helptag = "nvim-tree-api-git", section = "API: git", path = base .. "_meta/api/git.lua", }, - { helptag = "nvim-tree-api-health", section = "API: health", path = base .. "_meta/api/health.lua", }, - { helptag = "nvim-tree-api-map", section = "API: map", path = base .. "_meta/api/map.lua", }, - { helptag = "nvim-tree-api-marks", section = "API: marks", path = base .. "_meta/api/marks.lua", }, - { helptag = "nvim-tree-api-node", section = "API: node", path = base .. "_meta/api/node.lua", }, - { helptag = "nvim-tree-api-tree", section = "API: tree", path = base .. "_meta/api/tree.lua", }, - - { helptag = "nvim-tree-class", section = "PLACEHOLDER", path = placeholder, }, + { helptag = "nvim-tree-api", section = "API", path = base .. "api.lua", }, + { helptag = "nvim-tree-api-appearance", section = "API: appearance", path = base .. "_meta/api/appearance.lua", }, + { helptag = "nvim-tree-api-commands", section = "API: commands", path = base .. "_meta/api/commands.lua", }, + { helptag = "nvim-tree-api-events", section = "API: events", path = base .. "_meta/api/events.lua", }, + { helptag = "nvim-tree-api-filter", section = "API: filter", path = base .. "_meta/api/filter.lua", }, + { helptag = "nvim-tree-api-fs", section = "API: fs", path = base .. "_meta/api/fs.lua", }, + { helptag = "nvim-tree-api-git", section = "API: git", path = base .. "_meta/api/git.lua", }, + { helptag = "nvim-tree-api-map", section = "API: map", path = base .. "_meta/api/map.lua", }, + { helptag = "nvim-tree-api-marks", section = "API: marks", path = base .. "_meta/api/marks.lua", }, + { helptag = "nvim-tree-api-node", section = "API: node", path = base .. "_meta/api/node.lua", }, + { helptag = "nvim-tree-api-tree", section = "API: tree", path = base .. "_meta/api/tree.lua", }, + + { helptag = "nvim-tree-class", section = "PLACEHOLDER", path = placeholder, }, } ---@type Src[]