atom / markdown-preview

📝 Markdown preview in Atom
MIT License
1.23k stars 358 forks source link

preview not rendered anymore when file closed and reopened #440

Open xh3b4sd opened 8 years ago

xh3b4sd commented 8 years ago

I have the following scenario.

  1. I oen a file.
  2. I open the markdown preview.
  3. When I write the preview is rendered.
  4. I close the markdown file and reopen it with cmd-shift-t.
  5. When I write the preview is NOT rendered.

Also, when a file is closed and re-opened as described above, when I then use the toggle command another preview window is opened resulting in one orphaned window and one working window.

winstliu commented 8 years ago

What Atom version are you on @xh3b4sd? When you say "not working anymore", are you implying that it used to work? If so, what Atom version did it work on previously?

xh3b4sd commented 8 years ago

I am using Atom 1.11.1. When I said "not working anymore" I wanted to say that it works in step 3 of the steps described above, but not in step 5. So after closing and re-opening the file the preview window does not pick up changes of the markdown file "anymore".

winstliu commented 7 years ago

This is because we track editor <-> preview mapping using the internal editor ID, which changes each time the editor is opened. So even though the editor's contents are the same its ID is different. The preview can no longer find the editor ID so it falls back to low-level File events, which do not support live updating (but the preview will still update if you save the file).