Skip to content

Commit f55a655

Browse files
authored
Merge branch 'master' into chore-sed-bsd-compatibility
2 parents 982f71f + 87594aa commit f55a655

File tree

6 files changed

+63
-10
lines changed

6 files changed

+63
-10
lines changed

CONTRIBUTING.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ markdown-toc --maxdepth=2 -i CONTRIBUTING.md
2727
- [Windows](#windows)
2828
- [Pull Request](#pull-request)
2929
* [Subject](#subject)
30+
- [AI Usage Policy: Highly Discouraged](#ai-usage-policy-highly-discouraged)
31+
* [nvim-tree Is A Community Project](#nvim-tree-is-a-community-project)
32+
* [The Burden Of Review Must Not Increase](#the-burden-of-review-must-not-increase)
33+
* [AI Generated PR Rules](#ai-generated-pr-rules)
3034

3135
<!-- tocstop -->
3236

@@ -38,7 +42,7 @@ Language server: [luals](https://luals.github.io)
3842

3943
Lint: [luacheck](https://github.com/lunarmodules/luacheck/)
4044

41-
nvim-tree.lua migrated from stylua to EmmyLuaCodeStyle ~2024/10. `vim.lsp.buf.format()` may be used as it is the default formatter for luals, using an embedded [EmmyLuaCodeStyle](https://github.com/CppCXY/EmmyLuaCodeStyle)
45+
nvim-tree migrated from stylua to EmmyLuaCodeStyle ~2024/10. `vim.lsp.buf.format()` may be used as it is the default formatter for luals, using an embedded [EmmyLuaCodeStyle](https://github.com/CppCXY/EmmyLuaCodeStyle)
4246

4347
Formatting: [EmmyLuaCodeStyle](https://github.com/CppCXY/EmmyLuaCodeStyle): `CodeFormat` executable
4448

@@ -232,3 +236,45 @@ Available types:
232236
If in doubt, look at previous commits.
233237

234238
See also [The Conventional Commits ultimate cheatsheet](https://gist.github.com/gabrielecanepa/fa6cca1a8ae96f77896fe70ddee65527)
239+
240+
# AI Usage Policy: Highly Discouraged
241+
242+
## nvim-tree Is A Community Project
243+
244+
nvim-tree is a work of passion, building a community of free thinking individuals who contribute highly polished, elegant and maintainable code. Community members range from novices to professionals and all are welcome. Teaching, encouraging and celebrating the growth of less experienced developers is of great importance.
245+
246+
AI generated code is discouraged as this doesn't match these nvim-tree values.
247+
248+
Human PR reviews will always be prioritised over AI generated PRs.
249+
250+
## The Burden Of Review Must Not Increase
251+
252+
There must be a human in the loop at all times. The contributor is the author of and is fully accountable for AI generated contributions.
253+
254+
AI generated PRs have low, or even non-existent entry level. Human generated PRs require you to be motivated, do research, familiarise yourself with code, make effort to write the code and test it.
255+
256+
Low effort or unqualified code increases the burden of review and testing on maintainers, who are limited in time.
257+
258+
Contributors must:
259+
260+
- Read and review all generated code and documentation before raising a PR
261+
- Fully understand all code and documentation
262+
- Be able to answer any questions during review
263+
264+
## AI Generated PR Rules
265+
266+
The PR description and comments must be written by the contributor, with no AI assistance beyond grammar or English translations.
267+
268+
The description must:
269+
270+
- Describe the solution design, justifying all decisions
271+
- Clearly state which AI was used
272+
- List which code and documentation was written by a human and which was written by AI
273+
- Detail all testing performed
274+
275+
There must be far greater than usual number of detailed, explicit comments:
276+
277+
- File level: overview of the changes made
278+
- Line level: 1-2 comments per function/method
279+
280+
Do not enable or use any AI review tools (e.g. Copilot) on the Pull Request.

doc/nvim-tree-lua.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,9 +1709,11 @@ Config: filesystem_watchers *nvim-tree-config-filesystem-watchers*
17091709
between filesystem change and tree update.
17101710
• {ignore_dirs}? (`string[]|(fun(path: string): boolean)`, default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", "/.zig-cache"}`)
17111711
Disable for specific directories.
1712-
• {max_events}? (`integer`, default: `1000`) Disable for a single
1713-
directory after {max_events} consecutive events
1714-
with an interval < {debounce_delay}.
1712+
• {max_events}? (`integer`, default: `0` or `1000` on windows)
1713+
Disable for a single directory after {max_events}
1714+
consecutive events with an interval <
1715+
{debounce_delay}. Set to 0 to allow unlimited
1716+
consecutive events.
17151717

17161718

17171719

@@ -2182,7 +2184,7 @@ Following is the default configuration, see |nvim_tree.config| for details. >lua
21822184
filesystem_watchers = {
21832185
enable = true,
21842186
debounce_delay = 50,
2185-
max_events = 1000,
2187+
max_events = 0,
21862188
ignore_dirs = {
21872189
"/.ccls-cache",
21882190
"/build",

lua/nvim-tree.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ local DEFAULT_OPTS = { -- default-config-start
463463
filesystem_watchers = {
464464
enable = true,
465465
debounce_delay = 50,
466-
max_events = 1000,
466+
max_events = 0,
467467
ignore_dirs = {
468468
"/.ccls-cache",
469469
"/build",
@@ -738,6 +738,9 @@ local function localise_default_opts()
738738
if utils.is_macos or utils.is_windows then
739739
DEFAULT_OPTS.trash.cmd = "trash"
740740
end
741+
if utils.is_windows then
742+
DEFAULT_OPTS.filesystem_watchers.max_events = 1000
743+
end
741744
end
742745

743746
function M.purge_all_state()

lua/nvim-tree/_meta/config/filesystem_watchers.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ error("Cannot require a meta file")
3131
---@field ignore_dirs? string[]|(fun(path: string): boolean)
3232
---
3333
---Disable for a single directory after {max_events} consecutive events with an interval < {debounce_delay}.
34-
---(default: `1000`)
34+
---Set to 0 to allow unlimited consecutive events.
35+
---(default: `0` or `1000` on windows)
3536
---@field max_events? integer

lua/nvim-tree/explorer/watch.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ function M.create_watcher(node)
7979
watcher.data.outstanding_events = watcher.data.outstanding_events + 1
8080

8181
-- disable watcher when outstanding exceeds max
82-
if watcher.data.outstanding_events > M.config.filesystem_watchers.max_events then
82+
if M.config.filesystem_watchers.max_events > 0 and watcher.data.outstanding_events > M.config.filesystem_watchers.max_events then
8383
notify.error(string.format(
8484
"Observed %d consecutive file system events with interval < %dms, exceeding filesystem_watchers.max_events=%s. Disabling watcher for directory '%s'. Consider adding this directory to filesystem_watchers.ignore_dirs",
8585
watcher.data.outstanding_events,
86-
M.config.filesystem_watchers.max_events,
8786
M.config.filesystem_watchers.debounce_delay,
87+
M.config.filesystem_watchers.max_events,
8888
node.absolute_path
8989
))
9090
node:destroy_watcher()

lua/nvim-tree/git/utils.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ local M = {
1111
---@return integer exit code
1212
local function system(cmd)
1313
if vim.fn.has("nvim-0.10") == 1 then
14-
local obj = vim.system(cmd):wait()
14+
local obj = vim.system(cmd):wait(M.opts.git.timeout)
1515
return obj.stdout or "", obj.code
1616
else
1717
return vim.fn.system(cmd), vim.v.shell_error
@@ -199,6 +199,7 @@ function M.setup(opts)
199199
if opts.git.cygwin_support then
200200
M.use_cygpath = vim.fn.executable("cygpath") == 1
201201
end
202+
M.opts = opts
202203
end
203204

204205
return M

0 commit comments

Comments
 (0)