From be9078a92eaa5948dc818da1c9b2314117dd3f8b Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 7 Nov 2011 16:25:46 -0800 Subject: [PATCH] updating a file from outside the app is ACTUALLY reflected in atom now --- Atom/UKKQueue/UKKQueue.m | 2 +- extensions/tree/tree.coffee | 5 ++++- src/watcher.coffee | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Atom/UKKQueue/UKKQueue.m b/Atom/UKKQueue/UKKQueue.m index f4f46f2c4..39bbdcbc0 100644 --- a/Atom/UKKQueue/UKKQueue.m +++ b/Atom/UKKQueue/UKKQueue.m @@ -351,7 +351,7 @@ static UKKQueue * gUKKQueueSharedQueueSingleton = nil; if( n > 0 ) { if( ev.filter == EVFILT_VNODE ) - { + { if( ev.fflags ) { NSString* fpath = [[(NSString *)ev.udata retain] autorelease]; // In case one of the notified folks removes the path. diff --git a/extensions/tree/tree.coffee b/extensions/tree/tree.coffee index 80bf65a45..b6cd56927 100644 --- a/extensions/tree/tree.coffee +++ b/extensions/tree/tree.coffee @@ -38,6 +38,7 @@ class Tree extends Extension @pane.show() shutdown: -> + @unwatchDir window.path @unwatchDir dir for dir in @shownDirs() reload: -> @@ -46,7 +47,9 @@ class Tree extends Extension shownDirStorageKey: -> @.constructor.name + ":" + window.path + ":shownDirs" - watchDir: (dir) => + watchDir: (changeType, dir) => + # Update the paths. + @paths = @findPaths window.path @pane.reload() unwatchDir: (dir) -> diff --git a/src/watcher.coffee b/src/watcher.coffee index 167da2c04..2ea02ff96 100644 --- a/src/watcher.coffee +++ b/src/watcher.coffee @@ -27,6 +27,7 @@ class Watcher @watchedPaths[path] = (item for item in @watchedPaths[path] when item != callback) if not callback? or @watchedPaths[path].length == 0 @watchedPaths[path] = null + console.log "Unwatch #{path}" @queue.removePathFromQueue path # Delegate method for __AAWatcher__