From fc82479489c767bee23857a3a514b6c9a03ff28f Mon Sep 17 00:00:00 2001 From: Robert Lowe Date: Sun, 2 Dec 2018 20:53:15 -0500 Subject: [PATCH] Fixes Watcher/Autorunner for some editors (ex: TextMate) Fixes Watcher/Autorunner for some editors (ex: TextMate) --- lib/watcher.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/watcher.ex b/lib/watcher.ex index a8a683c..93cbc5f 100644 --- a/lib/watcher.ex +++ b/lib/watcher.ex @@ -12,7 +12,8 @@ defmodule Watcher do end def handle_info({:file_event, watcher_pid, {path, events}}, %{watcher_pid: watcher_pid} = state) do - if Enum.member?(events, :modified) do + # respond to renamed as well due to that some editors use temporary files for atomic writes (ex: TextMate) + if Enum.member?(events, :modified) || Enum.member?(events, :renamed) do path |> normalize |> reload end