Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically update preview while changing the markdown source #2

Closed
kieferrm opened this issue May 10, 2016 · 4 comments
Closed

Automatically update preview while changing the markdown source #2

kieferrm opened this issue May 10, 2016 · 4 comments

Comments

@kieferrm
Copy link
Owner

kieferrm commented May 10, 2016

From microsoft/vscode#6106:

we need to change the extension to update the preview based on document edits so that the preview updates while the user is typing

@kieferrm
Copy link
Owner Author

kieferrm commented May 10, 2016

Here is our initial thinking for how to update the side-by-side preview:

  1. The extension is listening to the document change events emitted by the workspace
  2. If we receive a document change event for a markdown document we translate that into a document change event for the virtual markdown preview document and let the registered document content provider fire that document change event
  3. Ensure the html preview editor reloads when it receives a document changed event from the document content provider

@bpasero
Copy link

bpasero commented May 10, 2016

I think that is the idea, also @jrieken fyi who provides the API for text document provider.

@jrieken
Copy link

jrieken commented May 10, 2016

Yes - your document provider can offer an event that signals change. This is an sample: https://github.com/Microsoft/vscode/blob/master/extensions/vscode-api-tests/src/workspace.test.ts#L299

@kieferrm
Copy link
Owner Author

@jrieken thanks. That's makes for a slick solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants