aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_watch.lua
diff options
context:
space:
mode:
authorTomas Slusny <slusnucky@gmail.com>2024-03-12 08:15:55 +0100
committerGitHub <noreply@github.com>2024-03-12 15:15:55 +0800
commit41fb98d6fab5aa02ef370d1b2b283b078517ffa4 (patch)
tree38248a21f926ef11d035afa238b9c4323b2e479d /runtime/lua/vim/_watch.lua
parent3bd84317fb59ed4f7ec6585c516f9f8f4d823fd6 (diff)
downloadrneovim-41fb98d6fab5aa02ef370d1b2b283b078517ffa4.tar.gz
rneovim-41fb98d6fab5aa02ef370d1b2b283b078517ffa4.tar.bz2
rneovim-41fb98d6fab5aa02ef370d1b2b283b078517ffa4.zip
fix: move fswatch linux check inside of vim.schedule (#27824)
Fixes issue reported in the original PR: https://github.com/neovim/neovim/pull/27810 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Diffstat (limited to 'runtime/lua/vim/_watch.lua')
-rw-r--r--runtime/lua/vim/_watch.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/lua/vim/_watch.lua b/runtime/lua/vim/_watch.lua
index 542e770246..23c810099e 100644
--- a/runtime/lua/vim/_watch.lua
+++ b/runtime/lua/vim/_watch.lua
@@ -289,10 +289,11 @@ function M.fswatch(path, opts, callback)
end
if data and #vim.trim(data) > 0 then
- 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.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