adobe/brackets — pull request #1897 by JakeStoeffler (2012-10-20 05:03:21+00:00)
Title: Fix for #1886

The cause of the browser refresh in #1886 is that `_onDocumentSaved()` thinks the Document being saved is an HTML Document, so an HTML live reload is triggered. But in reality, the Document being saved is a CSS Document in an inline editor.

Previously the `_onDocumentSaved()` method assumed that the Document being saved was the one returned by `_getCurrentDocument()`. In the case when an inline editor's Document is saved, `_getCurrentDocument()` returns the Document of the primary editor instead of the inline editor.

The actual saved Document is passed along when the `documentSaved` event is triggered in `Document.prototype.notifySaved()`:

$(exports).triggerHandler("documentSaved", this)

We just needed to accept the event data into `_onDocumentSaved()` and utilize it to determine the saved Document.

Note: An alternative solution would be to change the behavior of `_getCurrentDocument()` so that it returns the inline editor's Document, but I'm assuming we always want that to return the primary Document.