If I open a file and save it without making any modifications, it would be neat if justrun did not terminate the process. This would help prevent against unnecessary server reloads, also because I compulsively hit :w when I am working with a file in vim.
The implementation might be a little tricky. On Macs, here are the events that get generated when I save a file in TextEdit:
2018/01/05 17:09:13 unignored file change: "/Users/kevin/src/github.com/kevinburke/portfolio/static/dashboard.js": REMOVE
2018/01/05 17:09:13 unignored file change: "/Users/kevin/src/github.com/kevinburke/portfolio/static/dashboard.js": CREATE
2018/01/05 17:09:13 unignored file change: "/Users/kevin/src/github.com/kevinburke/portfolio/static/dashboard.js": CHMOD
2018/01/05 17:09:13 unignored file change: "/Users/kevin/src/github.com/kevinburke/portfolio/static/dashboard.js": CHMOD
So it wouldn't be enough to e.g. check only for single events, since you'd have to wait for the second or third event to determine "the file is still there and didn't change". You could check right after you get the tick.C event if you have the delay turned on.
It would also be slow if a file was particularly large, though you could decide to bail on the "is this actually the same file" strategy after like 4MB or whatever.
See also fsnotify/fsnotify#232, but I'm not sure that's the right place for it.
If I open a file and save it without making any modifications, it would be neat if justrun did not terminate the process. This would help prevent against unnecessary server reloads, also because I compulsively hit
:wwhen I am working with a file in vim.The implementation might be a little tricky. On Macs, here are the events that get generated when I save a file in TextEdit:
So it wouldn't be enough to e.g. check only for single events, since you'd have to wait for the second or third event to determine "the file is still there and didn't change". You could check right after you get the tick.C event if you have the delay turned on.
It would also be slow if a file was particularly large, though you could decide to bail on the "is this actually the same file" strategy after like 4MB or whatever.
See also fsnotify/fsnotify#232, but I'm not sure that's the right place for it.