mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Fix view file in Edge failure issue if name contains spaces
Added Edge to the same case as the other browsers, which substitutes spaces for %20, and opens the files as expected and add legacy edge as a backup in case the new edge isn't found. Fix #9313, close #9677
This commit is contained in:
parent
874f0d0140
commit
bdae2aef92
@ -1989,6 +1989,7 @@ void Notepad_plus::command(int id)
|
||||
|
||||
case IDM_VIEW_IN_FIREFOX:
|
||||
case IDM_VIEW_IN_CHROME:
|
||||
case IDM_VIEW_IN_EDGE:
|
||||
case IDM_VIEW_IN_IE:
|
||||
{
|
||||
auto currentBuf = _pEditView->getCurrentBuffer();
|
||||
@ -2004,6 +2005,10 @@ void Notepad_plus::command(int id)
|
||||
{
|
||||
appName = TEXT("chrome.exe");
|
||||
}
|
||||
else if (id == IDM_VIEW_IN_EDGE)
|
||||
{
|
||||
appName = TEXT("msedge.exe");
|
||||
}
|
||||
else // if (id == IDM_VIEW_IN_IE)
|
||||
{
|
||||
appName = TEXT("IEXPLORE.EXE");
|
||||
@ -2027,7 +2032,18 @@ void Notepad_plus::command(int id)
|
||||
{
|
||||
::ShellExecute(NULL, TEXT("open"), valData, fullCurrentPath.c_str(), NULL, SW_SHOWNORMAL);
|
||||
}
|
||||
else
|
||||
else if (id == IDM_VIEW_IN_EDGE)
|
||||
{
|
||||
// Try the Legacy version
|
||||
|
||||
// Don't put the quots for Edge, otherwise it doesn't work
|
||||
//fullCurrentPath = TEXT("\"");
|
||||
generic_string fullCurrentPath = currentBuf->getFullPathName();
|
||||
//fullCurrentPath += TEXT("\"");
|
||||
|
||||
::ShellExecute(NULL, TEXT("open"), TEXT("shell:Appsfolder\\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge"), fullCurrentPath.c_str(), NULL, SW_SHOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
_nativeLangSpeaker.messageBox("ViewInBrowser",
|
||||
_pPublicInterface->getHSelf(),
|
||||
@ -2039,21 +2055,6 @@ void Notepad_plus::command(int id)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_VIEW_IN_EDGE:
|
||||
{
|
||||
auto currentBuf = _pEditView->getCurrentBuffer();
|
||||
if (!currentBuf->isUntitled())
|
||||
{
|
||||
// Don't put the quots for Edge, otherwise it doesn't work
|
||||
//fullCurrentPath = TEXT("\"");
|
||||
generic_string fullCurrentPath = currentBuf->getFullPathName();
|
||||
//fullCurrentPath += TEXT("\"");
|
||||
|
||||
ShellExecute(NULL, TEXT("open"), TEXT("shell:Appsfolder\\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge"), fullCurrentPath.c_str(), NULL, SW_SHOW);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_VIEW_TAB_SPACE:
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user