@@ -78,15 +78,15 @@ local function init_fs_watcher(dir_to_watch, is_library_root)
78
78
if is_library_root then
79
79
log .debug (" Filesystem event in the library root directory" )
80
80
entry_dir = Path (dir_to_watch , filename )
81
- info_path = entry_dir : joinpath ( info_name )
81
+ info_path = entry_dir / info_name
82
82
if entry_dir :exists () and entry_dir :is_dir () then
83
- log .debug (string.format (" Filesystem event: path '%s' added" , entry_dir : absolute ( )))
84
- init_fs_watcher (entry_dir : absolute ( ))
83
+ log .debug (string.format (" Filesystem event: path '%s' added" , tostring ( entry_dir )))
84
+ init_fs_watcher (tostring ( entry_dir ))
85
85
if info_path :exists () then
86
- mtime = fs_stat (info_path : absolute ( )).mtime .sec
86
+ mtime = fs_stat (tostring ( info_path )).mtime .sec
87
87
end
88
88
elseif entry_dir :is_dir () then
89
- log .debug (string.format (" Filesystem event: path '' removed" , entry_dir : absolute ( )))
89
+ log .debug (string.format (" Filesystem event: path '' removed" , tostring ( entry_dir )))
90
90
-- don't update here, because we'll catch it below under entry events
91
91
do_update = false
92
92
else
@@ -96,25 +96,25 @@ local function init_fs_watcher(dir_to_watch, is_library_root)
96
96
else
97
97
log .debug (" Filesystem event in entry directory" )
98
98
entry_dir = Path (dir_to_watch )
99
- info_path = entry_dir : joinpath ( info_name )
99
+ info_path = entry_dir / info_name
100
100
if info_path :exists () then
101
101
-- info file exists, update with new info
102
- log .debug (string.format (" Filesystem event: '%s' changed" , info_path : absolute ( )))
103
- mtime = fs_stat (info_path : absolute ( )).mtime .sec
102
+ log .debug (string.format (" Filesystem event: '%s' changed" , tostring ( info_path )))
103
+ mtime = fs_stat (tostring ( info_path )).mtime .sec
104
104
elseif not entry_dir :exists () then
105
105
-- info file and entry dir don't exist. delete entry (mtime = nil) and remove watcher
106
- log .debug (string.format (" Filesystem event: '%s' removed" , info_path : absolute ( )))
106
+ log .debug (string.format (" Filesystem event: '%s' removed" , tostring ( info_path )))
107
107
do_unwatch = true
108
108
else
109
109
-- info file doesn't exist but entry dir does. delete entry but keep watcher
110
- log .debug (string.format (" Filesystem event: '%s' removed" , info_path : absolute ( )))
110
+ log .debug (string.format (" Filesystem event: '%s' removed" , tostring ( info_path )))
111
111
end
112
112
end
113
113
if do_update then
114
114
log .debug (" Update database for this fs event..." )
115
- log .debug (" Updating: " .. vim .inspect ({ path = info_path : absolute ( ), mtime = mtime }))
115
+ log .debug (" Updating: " .. vim .inspect ({ path = tostring ( info_path ), mtime = mtime }))
116
116
vim .defer_fn (function ()
117
- data .update_db ({ path = info_path : absolute ( ), mtime = mtime })
117
+ data .update_db ({ path = tostring ( info_path ), mtime = mtime })
118
118
end , 200 )
119
119
elseif do_unwatch then
120
120
log .debug (" Removing watcher" )
0 commit comments