File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,23 @@ local function is_git(path)
22
22
return path :match " %.git$" ~= nil or path :match (utils .path_add_trailing " .git" ) ~= nil
23
23
end
24
24
25
+ local IGNORED_PATHS = {
26
+ -- disable watchers on kernel filesystems
27
+ -- which have a lot of unwanted events
28
+ " /sys" ,
29
+ " /proc" ,
30
+ " /dev" ,
31
+ }
32
+
33
+ local function is_folder_ignored (path )
34
+ for _ , folder in ipairs (IGNORED_PATHS ) do
35
+ if vim .startswith (path , folder ) then
36
+ return true
37
+ end
38
+ end
39
+ return false
40
+ end
41
+
25
42
local function refresh_path (path )
26
43
log .line (" watcher" , " node event executing '%s'" , path )
27
44
local n = utils .get_node_from_path (path )
@@ -41,7 +58,7 @@ function M.create_watcher(absolute_path)
41
58
if not M .enabled then
42
59
return nil
43
60
end
44
- if is_git (absolute_path ) then
61
+ if is_git (absolute_path ) or is_folder_ignored ( absolute_path ) then
45
62
return nil
46
63
end
47
64
You can’t perform that action at this time.
0 commit comments