diff --git a/platform/android/resources/build.xml b/platform/android/resources/build.xml index 248f47816..f8700c101 100644 --- a/platform/android/resources/build.xml +++ b/platform/android/resources/build.xml @@ -88,8 +88,8 @@ - - + + diff --git a/platform/mac/TextEditorSupport.m b/platform/mac/TextEditorSupport.m index a97e3fd85..b9323111e 100644 --- a/platform/mac/TextEditorSupport.m +++ b/platform/mac/TextEditorSupport.m @@ -118,7 +118,7 @@ void TextEditorSupport_LaunchTextEditorWithFile(NSString* file_name, NSInteger l [[NSWorkspace sharedWorkspace] openFile:file_name]; } } - else if([base_app_name isEqualToString:@"Sublime Text 2.app"] || [base_app_name isEqualToString:@"Sublime Text.app"]) + else if([base_app_name isEqualToString:@"Sublime Text 2.app"] || [base_app_name isEqualToString:@"Sublime Text.app"] || [base_app_name isEqualToString:@"Sublime Text 3.app"] ) { // From http://www.sublimetext.com/docs/2/osx_command_line.html diff --git a/platform/windows/Corona.Simulator/SimulatorView.cpp b/platform/windows/Corona.Simulator/SimulatorView.cpp index 3db62d6b4..b21f96ec1 100755 --- a/platform/windows/Corona.Simulator/SimulatorView.cpp +++ b/platform/windows/Corona.Simulator/SimulatorView.cpp @@ -986,6 +986,7 @@ void CSimulatorView::OnFileOpenInEditor() ASSOCF_INIT_DEFAULTTOSTAR, ASSOCSTR_EXECUTABLE, _T(".lua"), NULL, fileAssociation.GetBuffer(MAX_PATH_LENGTH), &fileAssociationLength); fileAssociation.ReleaseBuffer(); + CString fullAssociationPath(fileAssociation); if (S_OK == result) { index = fileAssociation.ReverseFind(_T('\\')); @@ -1021,7 +1022,23 @@ void CSimulatorView::OnFileOpenInEditor() // If Windows doesn't have a valid file association, then open it with Notepad. if (hasValidFileAssociation) { - ::ShellExecute(nullptr, _T("open"), GetDocument()->GetPath(), nullptr, nullptr, SW_SHOWNORMAL); + if (fileAssociation == _T("sublime_text.exe")) { + CString fullPath(GetDocument()->GetPath()); + index = fullPath.ReverseFind(_T('\\')); + if (index > 0) + { + CString dirPath(fullPath); + dirPath.Delete(index, dirPath.GetLength() - index); + fullPath.Insert(0, _T('"')); + fullPath.Append(_T("\" --add \"")); + fullPath.Append(dirPath); + fullPath.Append(_T("\"")); + } + ::ShellExecute(nullptr, nullptr, fullAssociationPath, fullPath, nullptr, SW_SHOWNORMAL); + } + else { + ::ShellExecute(nullptr, _T("open"), GetDocument()->GetPath(), nullptr, nullptr, SW_SHOWNORMAL); + } WinString appName; appName.SetTCHAR(fileAssociation); GetWinProperties()->GetAnalytics()->Log( "open-in-editor", "editor", appName.GetUTF8() );