Glavin001/atom-coffeescript-preview

Toggle command opens a new preview tab instead of closing the current one

Closed this issue · 2 comments

previewPane always has the value undefined after line 73 in coffeescript-preview.coffee. I haven't been able to figure out how to fix it though.

Here's why it needs to be fixed:

I have a CoffeeScript file open, I open the command palette, and choose CoffeeScript Preview: Toggle. A CoffeeScript preview tab appears to the right of the CoffeeScript file. Perfect.

I run the CoffeeScript Preview: Toggle command again. A new CoffeeScript Preview tab appears on top of the current one.

I close both CoffeeScript Preview tabs, then run the Toggle command again. Now there are three CoffeeScript Preview tabs!

Repeat, now there's four! Eventually Atom stops responding after so many have opened.

I close Atom, re-open it, open my CoffeeScript file, run the Toggle command—only one CoffeeScript Preview tab opens...

Yet the cycle continues.

Thank you for bringing this issue to my attention, @jordanbtucker. I have pushed and published a patch. Please let me know if there are any more issues. Thanks again for your support!

This is working great now. Thanks.