Closed Bug 1011031 Opened 11 years ago Closed 10 years ago

Project Editor: Reload file that has already been opened when changed on disk

Categories

(DevTools Graveyard :: WebIDE, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 33

People

(Reporter: bgrins, Assigned: bgrins)

References

Details

Attachments

(1 file, 2 obsolete files)

STR: Open a file in itchpad Edit the same file using a separate editor Select a different file, then reselect the first in itchpad Expected: The new data from the file is loaded into the editor Actual: The original data is still in the editor We don't want to overwrite editor content if the user is still editing a file, but if they've left and come back I think it is safe to reload from disk.
Summary: Itchpad: Reload file that has already been opened when changed on disk → Project Editor: Reload file that has already been opened when changed on disk
Attached patch file-change.patch (obsolete) — Splinter Review
Most of the changes here are for tests (I've added a new one for detecting external changes and for the image editor plugin). The code changes are to give editors support for their load() functions to be called more than once. Basically now it will reload the editor whenever selectShell is called. A future optimization could be to only call load() if we have detected a file change in the meantime. So, both (1) and (2) cause reloads, but we could add code to make just (1) reload. This would be quite a bit easier when we have FS.watch. 1) open File A -> navigate to File B -> [some external app edits File A] -> navigate to File A -> Reload from disk 2) open File A -> navigate to File B -> navigate to File A -> Reload from disk Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=843830f4e916
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Attachment #8443480 - Flags: review?(fayearthur)
Attached patch file-change.patch (obsolete) — Splinter Review
Looks like there is a leak on try in browser_projecteditor_editors_image.js - here is another patch with a couple of minor updates that maybe will take care of it.
Attachment #8443480 - Attachment is obsolete: true
Attachment #8443480 - Flags: review?(fayearthur)
Attachment #8443572 - Flags: review?(fayearthur)
Attachment #8443572 - Attachment is obsolete: true
Attachment #8443572 - Flags: review?(fayearthur)
Attachment #8443955 - Flags: review?(fayearthur)
Comment on attachment 8443955 [details] [diff] [review] file-change.patch Review of attachment 8443955 [details] [diff] [review]: ----------------------------------------------------------------- Sublime will automatically reload from disk if you've saved the content of the editor, but if there's anything unsaved it'll ask you before overwriting with the disk contents. We should consider that.
Attachment #8443955 - Flags: review?(fayearthur) → review+
(In reply to Heather Arthur [:harth] from comment #5) > Comment on attachment 8443955 [details] [diff] [review] > file-change.patch > > Review of attachment 8443955 [details] [diff] [review]: > ----------------------------------------------------------------- > > Sublime will automatically reload from disk if you've saved the content of > the editor, but if there's anything unsaved it'll ask you before overwriting > with the disk contents. We should consider that. Yeah, I like that idea. I'll file a follow up.
Keywords: checkin-needed
Blocks: 1029741
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 33
Depends on: 1033853
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: