mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 01:41:22 +02:00
IDE: src edit hints: do not show empty hints
git-svn-id: trunk@31239 -
This commit is contained in:
parent
7c49448b51
commit
9463fcca22
@ -2374,18 +2374,21 @@ begin
|
||||
finally
|
||||
ElementNames.Free;
|
||||
FreeListOfPCodeXYPosition(ListOfPCodeXYPosition);
|
||||
if chhoShowFocusHint in Options then begin
|
||||
Cmd:=EditorOpts.KeyMap.FindByCommand(ecFocusHint);
|
||||
if (Cmd<>nil) and (not IDEShortCutEmpty(Cmd.ShortcutA)) then begin
|
||||
HTMLHint:=HTMLHint+'<div class="focushint">Press '
|
||||
+KeyAndShiftStateToEditorKeyString(Cmd.ShortcutA)+' for focus</div>'+LineEnding;
|
||||
if HTMLHint<>'' then begin
|
||||
if (chhoShowFocusHint in Options) then begin
|
||||
Cmd:=EditorOpts.KeyMap.FindByCommand(ecFocusHint);
|
||||
if (Cmd<>nil) and (not IDEShortCutEmpty(Cmd.ShortcutA)) then begin
|
||||
HTMLHint:=HTMLHint+'<div class="focushint">Press '
|
||||
+KeyAndShiftStateToEditorKeyString(Cmd.ShortcutA)+' for focus</div>'+LineEnding;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
HTMLHint:='<html><head><link rel="stylesheet" href="lazdoc://lazarus/lazdoc.css" type="text/css"></head>'+LineEnding
|
||||
+'<body>'+LineEnding+HTMLHint+'</body>'+LineEnding;
|
||||
HTMLHint:='<html><head><link rel="stylesheet" href="lazdoc://lazarus/lazdoc.css" type="text/css"></head>'+LineEnding
|
||||
+'<body>'+LineEnding+HTMLHint+'</body>'+LineEnding;
|
||||
Result:=chprSuccess;
|
||||
end else
|
||||
Result:=chprFailed;
|
||||
end;
|
||||
debugln(['TCodeHelpManager.GetHTMLHint ',HTMLHint]);
|
||||
Result:=chprSuccess;
|
||||
end;
|
||||
|
||||
function TCodeHelpManager.GetPasDocCommentsAsHTML(Tool: TFindDeclarationTool;
|
||||
|
11
ide/main.pp
11
ide/main.pp
@ -16127,6 +16127,7 @@ var
|
||||
ActiveUnitInfo: TUnitInfo;
|
||||
BaseURL, SmartHintStr, Expression, DebugEval, DebugEvalDerefer: String;
|
||||
DBGType,DBGTypeDerefer: TDBGType;
|
||||
HasHint: Boolean;
|
||||
begin
|
||||
//DebugLn(['TMainIDE.OnSrcNotebookShowHintForSource START']);
|
||||
if (SrcEdit=nil) then exit;
|
||||
@ -16141,11 +16142,14 @@ begin
|
||||
writeln('');
|
||||
writeln('[TMainIDE.OnSrcNotebookShowHintForSource] ************ ',ActiveUnitInfo.Source.Filename,' X=',CaretPos.X,' Y=',CaretPos.Y);
|
||||
{$ENDIF}
|
||||
HasHint:=false;
|
||||
if EditorOpts.AutoToolTipSymbTools then begin
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.OnSrcNotebookShowHintForSource A');{$ENDIF}
|
||||
TIDEHelpManager(HelpBoss).GetHintForSourcePosition(ActiveUnitInfo.Filename,
|
||||
if TIDEHelpManager(HelpBoss).GetHintForSourcePosition(ActiveUnitInfo.Filename,
|
||||
CaretPos,BaseURL,SmartHintStr,
|
||||
[{$IFDEF EnableFocusHint}ihmchAddFocusHint{$ENDIF}]);
|
||||
[{$IFDEF EnableFocusHint}ihmchAddFocusHint{$ENDIF}])=shrSuccess
|
||||
then
|
||||
HasHint:=true;
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.OnSrcNotebookShowHintForSource B');{$ENDIF}
|
||||
end;
|
||||
case ToolStatus of
|
||||
@ -16180,6 +16184,7 @@ begin
|
||||
end;
|
||||
FreeAndNil(DBGType);
|
||||
FreeAndNil(DBGTypeDerefer);
|
||||
HasHint:=true;
|
||||
Expression := Expression + ' = ' + DebugEval;
|
||||
if SmartHintStr<>'' then
|
||||
SmartHintStr:=LineEnding+LineEnding+SmartHintStr;
|
||||
@ -16187,7 +16192,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
if SmartHintStr <> '' then
|
||||
if HasHint then
|
||||
SrcEdit.ActivateHint(ClientPos, BaseURL, SmartHintStr);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user