@@ -4100,35 +4100,39 @@ void CNppExec::OnHelpManual()
41004100 }
41014101 }
41024102
4103- sHelpFile .Replace ( _T (' / ' ), _T ( ' \\ ' ) );
4104- if ( NppExecHelpers::IsFullPath ( sHelpFile ) )
4103+ const bool isURL = ( sHelpFile .Find ( _T (" :// " )) > 0 );
4104+ if ( !isURL )
41054105 {
4106- if ( !NppExecHelpers::CheckFileExists (sHelpFile ) )
4107- return ; // file does not exist, nothing to do
4108- }
4109- else
4110- {
4111- // sHelpFile is a relative pathname
4112- if ( sHelpFile .GetFirstChar () == _T (' \\ ' ) )
4113- sHelpFile .DeleteFirstChar ();
4114-
4115- // first, trying the folder at the level of NppExec.dll
4116- tstr sHelpFilePath = getPluginDllPath ();
4117- sHelpFilePath += _T (' \\ ' );
4118- sHelpFilePath += sHelpFile ;
4119- if ( !NppExecHelpers::CheckFileExists (sHelpFilePath ) )
4106+ sHelpFile .Replace ( _T (' /' ), _T (' \\ ' ) );
4107+ if ( NppExecHelpers::IsFullPath (sHelpFile ) )
4108+ {
4109+ if ( !NppExecHelpers::CheckFileExists (sHelpFile ) )
4110+ return ; // file does not exist, nothing to do
4111+ }
4112+ else
41204113 {
4121- // then, trying the folder one level upper
4122- sHelpFilePath = NppExecHelpers::GetFileNamePart (getPluginDllPath (), NppExecHelpers::fnpDirPath);
4114+ // sHelpFile is a relative pathname
4115+ if ( sHelpFile .GetFirstChar () == _T (' \\ ' ) )
4116+ sHelpFile .DeleteFirstChar ();
4117+
4118+ // first, trying the folder at the level of NppExec.dll
4119+ tstr sHelpFilePath = getPluginDllPath ();
4120+ sHelpFilePath += _T (' \\ ' );
41234121 sHelpFilePath += sHelpFile ;
41244122 if ( !NppExecHelpers::CheckFileExists (sHelpFilePath ) )
4125- return ; // file does not exist, nothing to do
4123+ {
4124+ // then, trying the folder one level upper
4125+ sHelpFilePath = NppExecHelpers::GetFileNamePart (getPluginDllPath (), NppExecHelpers::fnpDirPath);
4126+ sHelpFilePath += sHelpFile ;
4127+ if ( !NppExecHelpers::CheckFileExists (sHelpFilePath ) )
4128+ return ; // file does not exist, nothing to do
4129+ }
4130+ sHelpFile .Swap (sHelpFilePath );
41264131 }
4127- sHelpFile .Swap (sHelpFilePath );
41284132 }
4129-
4133+
41304134#ifndef __MINGW32__
4131- if ( sHelpFile .Find (_T (" .chm" )) > 0 )
4135+ if ( sHelpFile .Find (_T (" .chm" )) > 0 && !isURL )
41324136 ::HtmlHelp ( NULL , sHelpFile .c_str(), HH_DISPLAY_TOPIC, NULL );
41334137 else
41344138#endif
0 commit comments