Method: VimMate::Plugin::INotifyDirectory::ClassMethods#start_inotify_watcher
- Defined in:
- lib/vim_mate/plugins/inotify/lib/directory.rb
#start_inotify_watcher ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/vim_mate/plugins/inotify/lib/directory.rb', line 37 def start_inotify_watcher inotify_watcher.start do |event| next if ignore_file_changes? event.filename path = File.join(event.path, event.filename) case event.type when 'modify' ActiveWindow::Signal.emit_file_modified(path) when /^delete|moved_from$/ ActiveWindow::Signal.emit_file_deleted(path) when /^create|moved_to$/ ActiveWindow::Signal.emit_file_created(path) end end end |