Skip to content

Commit

Permalink
Print /fullpath/file in the message if the file was modified or deleted.
Browse files Browse the repository at this point in the history
If two files with the same name were modified or deleted then we don't
know which one is about to be reloaded or saved.
  • Loading branch information
Bost committed Oct 23, 2014
1 parent fa158d5 commit 1325f25
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lt/objs/editor/pool.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
(when-let [ed (first (by-path f))]
(when-not (doc/check-mtime (doc/->stats f) stat)
(if (:dirty @ed)
(active-warn ed {:header "This file has been modified."
(active-warn ed {:header (str "File modified: " f)
:body "This file seems to have been modified outside of Light Table. Do you want to load the latest and lose your changes?"
:buttons [{:label "Reload from disk"
:action (fn []
Expand All @@ -138,8 +138,8 @@
]})
(reload ed)))))))

(defn warn-delete [ed]
(active-warn ed {:header "This file has been deleted."
(defn warn-delete [f ed]
(active-warn ed {:header (str "File deleted: " f)
:body "This file seems to have been deleted and we've marked it as unsaved."
:buttons [{:label "Save as.."
:action (fn []
Expand All @@ -151,7 +151,7 @@
:reaction (fn [ws del]
(if-let [ed (first (by-path del))]
(do
(warn-delete ed)
(warn-delete del ed)
(make-transient-dirty ed)
(when-let [ts (:lt.objs.tabs/tabset @ed)]
(object/raise ts :tab.updated)))
Expand All @@ -160,7 +160,7 @@
false)
(object/by-tag :editor))]
(doseq [ed open]
(warn-delete ed)
(warn-delete del ed)
(make-transient-dirty ed))))))

(behavior ::watched.rename
Expand Down

0 comments on commit 1325f25

Please sign in to comment.