Permalink
Browse files

Make `--navigateToChanged` more robust on Windows

This ensures the new "open 'current content page' in browser" works
on Windows, especially with Emacs and Vim.

Special thanks to @bep for coming up with the idea of the fix.

See #3645
  • Loading branch information...
anthonyfok authored and bep committed Jun 27, 2017
1 parent c825a73 commit 30e14cc31678ddc204b082ab362f86b6b8063881
Showing with 5 additions and 3 deletions.
  1. +5 −3 commands/hugo.go
View
@@ -1028,13 +1028,15 @@ func (c *commandeer) newWatcher(port int) error {
}
func pickOneWritePath(events []fsnotify.Event) string {
name := ""
for _, ev := range events {
if ev.Op&fsnotify.Write == fsnotify.Write {
return ev.Name
if ev.Op&fsnotify.Write == fsnotify.Write && len(ev.Name) > len(name) {
name = ev.Name
}
}
return ""
return name
}
func (c *commandeer) isStatic(path string) bool {

0 comments on commit 30e14cc

Please sign in to comment.