Skip to content

[CLOSED] Fix Live Preview for Docs not in Working Set #7701

@core-ai-bot

Description

@core-ai-bot

Issue by redmunds
Thursday Jul 31, 2014 at 15:24 GMT
Originally opened as adobe/brackets#8605


The simple recipe in #7886 uncovers a big design flaw in live preview where docs not in the working set don't work. I suspect that many reported problems and open issues are related to this subtle difference.

The issue is that live preview caches HTMLDocument objects, but the Document and Editor objects that it references are only maintained when doc is in the working set. When doc is not in the working set, a new Document and Editor object is created every time it is selected in project tree.

This PR makes 2 changes:

  1. HTMLDocument now ref counts this.doc Document so it persists while Live Preview is connected.
  2. HTMLDocument now listens for activeEditorChange event to handle Editor changes. This includes proper updating of event listeners and HTMLInstrumentation.

redmunds included the following code: https://github.com/adobe/brackets/pull/8605/commits

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions