madflow / flow-netbeans-markdown

Markdown file support for the NetBeans IDE
MIT License
279 stars 40 forks source link

The 'Preview in external browser' opens default editor for MD files #92

Closed jerry1970 closed 8 years ago

jerry1970 commented 9 years ago

When I click on the 'Prevew in external browser' icon (not sure if that's from your plugin, by the way!), Notepad++ is opened, which is my system set application for editing MD files.

If this button is part of the plugin, how can I tell it to use my browser? I assume a temporary HTML file is written? That should open my browser, so I think something else is the matter.

Thanks

madflow commented 9 years ago

It should open the default Web Browser configured in Tools->Options->General->Web Browser. Please check your settings and try again - this should do the trick though :D.

jerry1970 commented 9 years ago

Must be something wrong with my system (Win7). That setting was set to 'default system browser' but even when I set it to Firefox, it keeps opening Notepad++, like it's sending the MD file to the system and not an HTML file.

madflow commented 9 years ago

Okay - we changed this behavior and I did not notice this because I would always use the Editor preview.

@stengerh In https://github.com/madflow/flow-netbeans-markdown/commit/36f617e5575ff6743c6685bd3cbb8e1eac3d4a49 we changed URLDisplayer.getDefault().showURL(temp.toURI().toURL()); to `URLDisplayer.getDefault().showURLExternal(url);``. Was this intentional? When I change it back - the Browser configured in Netbeans is chosen.

stengerh commented 9 years ago

Yes, I think it was intentional but there might be good reasons to restore the old behaviour. As far as I remember I wanted the action to always open the generated HTML in an external browser and not in the embedded WebKit browser. The latter seemed redundant since the new Editor preview used the some rendering technology.

Considering this and other recently reported issues it seems best to use the showURL method again.

jerry1970 commented 9 years ago

I guess that means that with the next version I will have a better working Preview tab?

I've never compiled NB plugins from source before so I am not sure if I can be of any help testing. If someone can compile it I can install it and am willing to test it.

jerry1970 commented 9 years ago

Just installed the latest development release (see #90 ) and the 2.3 pre-release of the plugin, but this still opens Notepad++ as if my system was trying to open an MD file and not an HTML file.

stengerh commented 9 years ago

The pre-release does not contain any changes regarding the "Preview in external browser" button.

By the way, what happens when you double-click an HTML file in Windows Explorer?

jerry1970 commented 9 years ago

OK, thanks.

When I double click an .html (or .htm) file, it opens in Firefox which is set as my default browser. I know what you wanted to test, I should have mentioned I already checked that.