ranmocy / guard-rails

Guard-Rails is watching on your development servers as you wish!
http://ranmocy.github.com/guard-rails
MIT License
137 stars 25 forks source link

Weird behaviour when saving with vim #25

Closed pablox-cl closed 10 years ago

pablox-cl commented 10 years ago

If I save config/application.rb with vim, I get the following:

22:54:49 - DEBUG - Trying to run Guard::Rails#run_on_removals with ["config/application.rb", "config/4913"]

...and therefore I get the server restarted twice.

If I just touch the file, or I save it with another text editor, I get the correct behaviour.

ranmocy commented 10 years ago

I believe it's the problem of your vim plugins which generate the config/4913 temp file. Try again with your bared vim without any plugins.

ranmocy commented 10 years ago

Closed. You can reopen if have further question.

pablox-cl commented 10 years ago

Sorry, I thought I had answered =/. Well, thing it's that I have found related issues with inotify:

https://groups.google.com/forum/#!topic/vim_dev/sppdpElxY44 https://stackoverflow.com/questions/10300835/too-many-inotify-events-while-editing-in-vim

It seems that it's a "standard" file created (though, it seems it's done with one specific option rather than from a plugin).

Vim source: https://code.google.com/p/vim/source/browse/src/fileio.c#3767

Maybe then the issue it's how guard looks the directories?

ranmocy commented 10 years ago

I believe guard listen on the directories by system io events. I suggest you to configure your Vim and set these files into /tmp or some place.

pablox-cl commented 10 years ago

There was a bug with listen. It has been solved in 2.7.3 (vim needs IN_CLOSE_WRITE; :close_write) . Sorry for the noise, I'm just familiarizing with inotify and family :)

ranmocy commented 10 years ago

Conversations are always welcomed. Thank you for telling me the bug in listen.