Make it handle how vim saves files #38

wants to merge 1 commit into


None yet

3 participants

delfick commented Mar 3, 2013

It would appear that the way vim saves files breaks how watchr determines when something has changed.

So, my change does:

  • Assumes args into listener always has [event, fragment]
  • Uses isIgnoredFile on the fragment, so I can add /^4913$/ to the ignored patterns and have it ignore vim's test 4913 file (
  • Says if listening on a file and the event is a rename to itself then we ignore it because a change event will happen.
  • A directory is not the same if the event is a change, even if the size and mtimes are the same.

Unfortunately, I'm not entirely sure if this has any undesired side effects. I'm hoping you people will have a better idea of such things :)



Just tried this out with @adrianolaru for docpad/docpad#477 who was reporting that watchr doesn't pick up and subsequent changes using vim, unfortunately it didn't work! Any ideas? Vim works perfectly for myself with watchr...


I have set noswapfile and set nobackup lines in my vimrc and no changes are picked up when editing in vim. If I commenting out the set noswapfile setting, watchr is picking up the changes, but it's not actually an update change, it's a delete and create combo, but i guess this is how vim works.


Implemented a fix in v2.4.1. Let me know if it fixes the issue for you as well. Closing for now, will re-open if it is still a problem.

@balupton balupton closed this Apr 10, 2013
delfick commented Apr 10, 2013

I just tried it with v2.4.3 and it would seem it doesn't work.

It would appear that my commit applied to v2.4.3 still fixes the issue.
(I have swap files in a ~/.vimswap folder, the issue I see is that vim will rename the file when it saves and watchr gets confused by this)


Hrmm, lets arrange a time when I can remote in.

For a bit of background, there is also an issue with Sublime Text 3 that I'm trying to nail at the same time. Also packed with different OS implementations this is becoming quite hard to track down.

delfick commented Apr 11, 2013

I sent you an email using the email address on your github profile. I'm not sure if you got it.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment