mirror of
https://github.com/nvim-tree/nvim-tree.lua
synced 2024-09-16 14:34:03 +02:00
* feat(#2092): add api.node.navigate.open.next, prev * feat(#2092): add api.node.navigate.listed.next, prev * feat(#2092): add api.node.navigate.opened.next, prev * feat(#2092): add api.node.navigate.opened.next, prev
This commit is contained in:
parent
7cd722ff3a
commit
0c9bfe7225
4 changed files with 59 additions and 32 deletions
|
@ -7,3 +7,6 @@ end_of_line = lf
|
|||
[*.lua]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[nvim-tree-lua.txt]
|
||||
max_line_length = 78
|
||||
|
|
|
@ -868,8 +868,10 @@ UI rendering setup
|
|||
Type: `boolean`, Default: `false`
|
||||
|
||||
*nvim-tree.renderer.highlight_opened_files*
|
||||
Highlight icons and/or names for opened files using the
|
||||
Highlight icons and/or names for |bufloaded()| files using the
|
||||
`NvimTreeOpenedFile` highlight group.
|
||||
See |nvim-tree.api.navigate.opened.next()| and
|
||||
|nvim-tree.api.navigate.opened.prev()|
|
||||
Value can be `"none"`, `"icon"`, `"name"` or `"all"`.
|
||||
Type: `string`, Default: `"none"`
|
||||
|
||||
|
@ -1033,7 +1035,7 @@ Filtering options.
|
|||
Type: `boolean`, Default: `false`
|
||||
|
||||
*nvim-tree.filters.no_buffer*
|
||||
Do not show files that have no listed buffer.
|
||||
Do not show files that have no |buflisted()| buffer.
|
||||
Toggle via the `toggle_no_buffer` action, default mapping `B`.
|
||||
For performance reasons this may not immediately update on buffer
|
||||
delete/wipe. A reload or filesystem event will result in an update.
|
||||
|
@ -1446,10 +1448,28 @@ api.tree.toggle_help() *nvim-tree.api.tree.toggle_help()*
|
|||
- navigate.sibling.last
|
||||
- navigate.parent
|
||||
- navigate.parent_close
|
||||
- navigate.git.next
|
||||
- navigate.git.prev
|
||||
- navigate.diagnostics.next
|
||||
- navigate.diagnostics.prev
|
||||
|
||||
api.node.navigate.git.next() *nvim-tree.api.navigate.git.next()*
|
||||
Navigate to the next item showing git status.
|
||||
|
||||
api.node.navigate.git.prev() *nvim-tree.api.navigate.git.prev()*
|
||||
Navigate to the previous item showing git status.
|
||||
|
||||
*nvim-tree.api.navigate.diagnostics.next()*
|
||||
api.node.navigate.diagnostics.next()
|
||||
Navigate to the next item showing diagnostic status.
|
||||
|
||||
*nvim-tree.api.navigate.diagnostics.prev()*
|
||||
api.node.navigate.diagnostics.prev()
|
||||
Navigate to the next item showing diagnostic status.
|
||||
|
||||
api.node.navigate.opened.next() *nvim-tree.api.navigate.opened.next()*
|
||||
Navigate to the next |bufloaded()| item.
|
||||
See |nvim-tree.renderer.highlight_opened_files|
|
||||
|
||||
api.node.navigate.opened.prev() *nvim-tree.api.navigate.opened.prev()*
|
||||
Navigate to the previous |bufloaded()| item.
|
||||
See |nvim-tree.renderer.highlight_opened_files|
|
||||
|
||||
- api.git: *nvim-tree.api.git*
|
||||
- reload
|
||||
|
|
|
@ -18,6 +18,8 @@ function M.fn(where, what)
|
|||
valid = explorer_node.get_git_status(node) ~= nil
|
||||
elseif what == "diag" then
|
||||
valid = node.diag_status ~= nil
|
||||
elseif what == "opened" then
|
||||
valid = vim.fn.bufloaded(node.absolute_path) ~= 0
|
||||
end
|
||||
|
||||
if not first and valid then
|
||||
|
|
|
@ -2,7 +2,7 @@ local notify = require "nvim-tree.notify"
|
|||
|
||||
local Api = {
|
||||
tree = {},
|
||||
node = { navigate = { sibling = {}, git = {}, diagnostics = {} }, run = {}, open = {} },
|
||||
node = { navigate = { sibling = {}, git = {}, diagnostics = {}, opened = {} }, run = {}, open = {} },
|
||||
events = {},
|
||||
marks = { bulk = {}, navigate = {} },
|
||||
fs = { copy = {} },
|
||||
|
@ -158,6 +158,8 @@ Api.node.navigate.git.next = inject_node(require("nvim-tree.actions.moves.item")
|
|||
Api.node.navigate.git.prev = inject_node(require("nvim-tree.actions.moves.item").fn("prev", "git"))
|
||||
Api.node.navigate.diagnostics.next = inject_node(require("nvim-tree.actions.moves.item").fn("next", "diag"))
|
||||
Api.node.navigate.diagnostics.prev = inject_node(require("nvim-tree.actions.moves.item").fn("prev", "diag"))
|
||||
Api.node.navigate.opened.next = inject_node(require("nvim-tree.actions.moves.item").fn("next", "opened"))
|
||||
Api.node.navigate.opened.prev = inject_node(require("nvim-tree.actions.moves.item").fn("prev", "opened"))
|
||||
|
||||
Api.git.reload = require("nvim-tree.actions.reloaders.reloaders").reload_git
|
||||
|
||||
|
|
Loading…
Reference in a new issue