-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Po files does not reloads when editing it with Sublime Text #494
Comments
Nice catch! For now, please disable atomic save. |
FileMonitor.monitor(FileMonitor.MODIFY, Paths.get("public"), { path =>
val fileName = path.getFileName.toString
Log.debug(fileName)
}) This code print out both file creation and modification in public directory. touch public/some.txt
// file creation event
echo "hello" >> public/some.txt
// file modification |
MMm... touch public/some.txt
// file creation event
echo "hello" >> public/some.txt
// file modification Works for me too. But saving in sublime still not works. My test case: import xitrum.util._
import java.nio.file.Paths
object Main {
def main(args: Array[String]) {
FileMonitor.monitor(FileMonitor.MODIFY, Paths.get("/tmp/"), { path =>
val fileName = path.getFileName.toString
println("MODIFY", fileName)
})
FileMonitor.monitor(FileMonitor.MODIFY, Paths.get("/tmp/"), { path =>
val fileName = path.getFileName.toString
println("CREATE", fileName)
})
}
} I open some file in sublime and then edit it. My logs: (CREATE,.sublfe4.tmp)
(MODIFY,.sublfe4.tmp)
(CREATE,.subleb.tmp)
(MODIFY,.subleb.tmp)
(CREATE,.subl55a.tmp)
(MODIFY,.subl55a.tmp)
(CREATE,.subl88a.tmp)
(MODIFY,.subl88a.tmp)
(CREATE,.subl1db.tmp)
(MODIFY,.subl1db.tmp)
(CREATE,.subl788.tmp)
(MODIFY,.subl788.tmp)
(CREATE,sbt3496251095913698347.log)
(MODIFY,sbt3496251095913698347.log) Looks like my sublime use move command, that does not handle at all with FileMonitor! Try this: mv /tmp/test.tmp /tmp/test Env: java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
Sublime Text 3 Build 3059
Linux caiiiycuk-desktop 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux |
I think this problem is caused by platform.
|
Probably (and probably not) related to lloydmeta/schwatcher#49 |
Hi!
I found that po files does not reloads when I edit it with Sublime Text. It is because sublime use
atomic save
feature, as said here http://stackoverflow.com/a/20639093/1213348. Sublime save changes in temporary file and then replace original file with it. In this caseFileMonitor.CREATE
event will send notFileMonitor.MODIFY
, xitrum does not handle this event for Po files. I think that this is incorrect behaviour, what do you think?The text was updated successfully, but these errors were encountered: