aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_watch.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
commitff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch)
tree729bbcb92231538fa61dab6c3d890b025484b7f5 /runtime/lua/vim/_watch.lua
parent376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff)
parent28c04948a1c887a1cc0cb64de79fa32631700466 (diff)
downloadrneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'runtime/lua/vim/_watch.lua')
-rw-r--r--runtime/lua/vim/_watch.lua18
1 files changed, 13 insertions, 5 deletions
diff --git a/runtime/lua/vim/_watch.lua b/runtime/lua/vim/_watch.lua
index 97c5481ad1..02b3f536c2 100644
--- a/runtime/lua/vim/_watch.lua
+++ b/runtime/lua/vim/_watch.lua
@@ -200,11 +200,13 @@ function M.watchdirs(path, opts, callback)
local max_depth = 100
for name, type in vim.fs.dir(path, { depth = max_depth }) do
- local filepath = vim.fs.joinpath(path, name)
- if type == 'directory' and not skip(filepath, opts) then
- local handle = assert(uv.new_fs_event())
- handles[filepath] = handle
- handle:start(filepath, {}, create_on_change(filepath))
+ if type == 'directory' then
+ local filepath = vim.fs.joinpath(path, name)
+ if not skip(filepath, opts) then
+ local handle = assert(uv.new_fs_event())
+ handles[filepath] = handle
+ handle:start(filepath, {}, create_on_change(filepath))
+ end
end
end
@@ -290,6 +292,10 @@ function M.fswatch(path, opts, callback)
if data and #vim.trim(data) > 0 then
vim.schedule(function()
+ if vim.fn.has('linux') == 1 and vim.startswith(data, 'Event queue overflow') then
+ data = 'inotify(7) limit reached, see :h fswatch-limitations for more info.'
+ end
+
vim.notify('fswatch: ' .. data, vim.log.levels.ERROR)
end)
end
@@ -303,6 +309,8 @@ function M.fswatch(path, opts, callback)
fswatch_output_handler(line, opts, callback)
end
end,
+ -- --latency is locale dependent but tostring() isn't and will always have '.' as decimal point.
+ env = { LC_NUMERIC = 'C' },
})
return function()