-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fails to Open in Browser if File "Untitled" #50
Comments
The issue isn't reliably reproducible for me. open-in-browser/lib/open-in-browser.coffee Lines 23 to 24 in 0ab8143
That causes the promise from
|
This plugin relies on open-in-browser/lib/open-in-browser.coffee Lines 12 to 13 in 0ab8143
open-in-browser/lib/open-in-browser.coffee Lines 20 to 21 in 0ab8143
|
For opening from the text editor (not from tree view) it relies on editor to return a file path: open-in-browser/lib/open-in-browser.coffee Lines 10 to 11 in 0ab8143
open-in-browser/lib/open-in-browser.coffee Lines 17 to 18 in 0ab8143
but for "Untitled" files which haven't yet been saved – this issue – there's no path returned. |
I know this error is old... but I found this page when I was trying to figure out what was going on. Eventually, I noticed that this error is only caused when you right click outside of the file name itself - so it's failing to pick up the filename you want to open in a browser. If you make sure you click on the filename itself and then on 'open in browser' it seems to solve the problem. |
open-in-browser will produce the following error when attempting to open a document that hasn't yet been saved to disk.
Steps to reproduce:
cmd-n
<html><p>blah blah blah</p></html>
Work around is to save the file first. Under most circumstances this probably isn't an issue since you are probably already working with a file that's been saved. In this case, however, I'm just working with a temporary window in order to copy and paste the working code into an online HTML editor.
I wonder if there's a way to trap when a file is in a modified state, if yes then do something else like prompt to save or pop up a message that changes must be saved before they will be visible in the browser.
The above would also be helpful for files that do exist on disk but when recent changes haven't been saved prior to launching the browser.
The text was updated successfully, but these errors were encountered: