Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d35a8d5ec6 | ||
|
|
d16246a757 | ||
|
|
863cf832ce | ||
|
|
c7d4650c38 | ||
|
|
4a87b8b46b |
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@@ -2,13 +2,6 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- release-please--branches--master--components--nvim-tree
|
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -46,7 +39,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: stylua
|
- name: stylua
|
||||||
uses: JohnnyMorganz/stylua-action@v3
|
uses: JohnnyMorganz/stylua-action@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
version: ${{ matrix.stylua_version }}
|
version: ${{ matrix.stylua_version }}
|
||||||
@@ -59,7 +52,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
nvim_version: [ v0.9.4 ]
|
nvim_version: [ stable, nightly ]
|
||||||
luals_version: [ 3.7.3 ]
|
luals_version: [ 3.7.3 ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -75,7 +68,11 @@ jobs:
|
|||||||
mkdir -p luals
|
mkdir -p luals
|
||||||
curl -L "https://github.com/LuaLS/lua-language-server/releases/download/${{ matrix.luals_version }}/lua-language-server-${{ matrix.luals_version }}-linux-x64.tar.gz" | tar zx --directory luals
|
curl -L "https://github.com/LuaLS/lua-language-server/releases/download/${{ matrix.luals_version }}/lua-language-server-${{ matrix.luals_version }}-linux-x64.tar.gz" | tar zx --directory luals
|
||||||
|
|
||||||
|
- run: echo "luals/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
- name: make check
|
- name: make check
|
||||||
run: VIMRUNTIME=/home/runner/nvim-${{ matrix.nvim_version }}/share/nvim/runtime PATH="luals/bin:${PATH}" make check
|
env:
|
||||||
|
VIMRUNTIME: /home/runner/nvim-${{ matrix.nvim_version }}/share/nvim/runtime
|
||||||
|
run: make check
|
||||||
|
|
||||||
- run: make help-check
|
- run: make help-check
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
".": "0.100.0"
|
".": "1.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,5 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.0.0](https://github.com/nvim-tree/nvim-tree.lua/compare/nvim-tree-v0.100.0...nvim-tree-v1.0.0) (2024-02-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **#2654:** filters.custom may be a function ([#2655](https://github.com/nvim-tree/nvim-tree.lua/issues/2655)) ([4a87b8b](https://github.com/nvim-tree/nvim-tree.lua/commit/4a87b8b46b4a30107971871df3cb7f4c30fdd5d0))
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* release 1.0.0 ([#2678](https://github.com/nvim-tree/nvim-tree.lua/issues/2678)) ([d16246a](https://github.com/nvim-tree/nvim-tree.lua/commit/d16246a7575538f77e9246520449b99333c469f7))
|
||||||
|
|
||||||
## [0.100.0](https://github.com/nvim-tree/nvim-tree.lua/compare/nvim-tree-v0.99.0...nvim-tree-v0.100.0) (2024-02-11)
|
## [0.100.0](https://github.com/nvim-tree/nvim-tree.lua/compare/nvim-tree-v0.99.0...nvim-tree-v0.100.0) (2024-02-11)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ Please install via your preferred package manager. See [Installation](https://gi
|
|||||||
|
|
||||||
`nvim-tree/nvim-tree.lua`
|
`nvim-tree/nvim-tree.lua`
|
||||||
|
|
||||||
|
Major or minor versions may be specified via tags: `v<MAJOR>` e.g. `v1` or `v<MAJOR>.<MINOR>` e.g. `v1.23`
|
||||||
|
|
||||||
`nvim-tree/nvim-web-devicons` optional, for file icons
|
`nvim-tree/nvim-web-devicons` optional, for file icons
|
||||||
|
|
||||||
Disabling [netrw](https://neovim.io/doc/user/pi_netrw.html) is strongly advised, see [:help nvim-tree-netrw](doc/nvim-tree-lua.txt)
|
Disabling [netrw](https://neovim.io/doc/user/pi_netrw.html) is strongly advised, see [:help nvim-tree-netrw](doc/nvim-tree-lua.txt)
|
||||||
|
|||||||
@@ -1262,7 +1262,7 @@ Enabling this is not useful as there is no means yet to persist bookmarks.
|
|||||||
Custom list of vim regex for file/directory names that will not be shown.
|
Custom list of vim regex for file/directory names that will not be shown.
|
||||||
Backslashes must be escaped e.g. "^\\.git". See |string-match|.
|
Backslashes must be escaped e.g. "^\\.git". See |string-match|.
|
||||||
Toggle via |nvim-tree-api.tree.toggle_custom_filter()|, default `U`
|
Toggle via |nvim-tree-api.tree.toggle_custom_filter()|, default `U`
|
||||||
Type: {string}, Default: `{}`
|
Type: {string} | `function(absolute_path)`, Default: `{}`
|
||||||
|
|
||||||
*nvim-tree.filters.exclude*
|
*nvim-tree.filters.exclude*
|
||||||
List of directories or files to exclude from filtering: always show them.
|
List of directories or files to exclude from filtering: always show them.
|
||||||
|
|||||||
@@ -623,6 +623,9 @@ local ACCEPTED_TYPES = {
|
|||||||
group_empty = { "boolean", "function" },
|
group_empty = { "boolean", "function" },
|
||||||
root_folder_label = { "function", "string", "boolean" },
|
root_folder_label = { "function", "string", "boolean" },
|
||||||
},
|
},
|
||||||
|
filters = {
|
||||||
|
custom = { "function" },
|
||||||
|
},
|
||||||
actions = {
|
actions = {
|
||||||
open_file = {
|
open_file = {
|
||||||
window_picker = {
|
window_picker = {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ local marks = require "nvim-tree.marks"
|
|||||||
local M = {
|
local M = {
|
||||||
ignore_list = {},
|
ignore_list = {},
|
||||||
exclude_list = {},
|
exclude_list = {},
|
||||||
|
custom_function = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
---@param path string
|
---@param path string
|
||||||
@@ -84,6 +85,11 @@ local function custom(path)
|
|||||||
|
|
||||||
local basename = utils.path_basename(path)
|
local basename = utils.path_basename(path)
|
||||||
|
|
||||||
|
-- filter user's custom function
|
||||||
|
if M.custom_function and M.custom_function(path) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
-- filter custom regexes
|
-- filter custom regexes
|
||||||
local relpath = utils.path_relative(path, vim.loop.cwd())
|
local relpath = utils.path_relative(path, vim.loop.cwd())
|
||||||
for pat, _ in pairs(M.ignore_list) do
|
for pat, _ in pairs(M.ignore_list) do
|
||||||
@@ -153,9 +159,13 @@ function M.setup(opts)
|
|||||||
M.exclude_list = opts.filters.exclude
|
M.exclude_list = opts.filters.exclude
|
||||||
|
|
||||||
local custom_filter = opts.filters.custom
|
local custom_filter = opts.filters.custom
|
||||||
if custom_filter and #custom_filter > 0 then
|
if type(custom_filter) == "function" then
|
||||||
for _, filter_name in pairs(custom_filter) do
|
M.custom_function = custom_filter
|
||||||
M.ignore_list[filter_name] = true
|
else
|
||||||
|
if custom_filter and #custom_filter > 0 then
|
||||||
|
for _, filter_name in pairs(custom_filter) do
|
||||||
|
M.ignore_list[filter_name] = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user