mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-05 12:49:33 +01:00
* on CtrlF1, first do an exact name search, only allow longer names if exact is not found
git-svn-id: trunk@6126 -
This commit is contained in:
parent
3696f6fbb7
commit
0ba499339a
@ -1326,7 +1326,7 @@ begin
|
|||||||
cmHelpContents : HelpContents;
|
cmHelpContents : HelpContents;
|
||||||
cmHelpIndex : HelpHelpIndex;
|
cmHelpIndex : HelpHelpIndex;
|
||||||
cmHelpDebug : HelpDebugInfos;
|
cmHelpDebug : HelpDebugInfos;
|
||||||
{ cmHelpTopicSearch: HelpTopicSearch;}
|
cmHelpTopicSearch: HelpTopicSearch;
|
||||||
cmHelpPrevTopic : HelpPrevTopic;
|
cmHelpPrevTopic : HelpPrevTopic;
|
||||||
cmHelpUsingHelp : HelpUsingHelp;
|
cmHelpUsingHelp : HelpUsingHelp;
|
||||||
cmHelpFiles : HelpFiles;
|
cmHelpFiles : HelpFiles;
|
||||||
|
|||||||
@ -833,6 +833,18 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
function THelpFacility.TopicSearch(Keyword: string; var FileID: word; var Context: THelpCtx): boolean;
|
function THelpFacility.TopicSearch(Keyword: string; var FileID: word; var Context: THelpCtx): boolean;
|
||||||
|
function ScanHelpFileExact(H: PHelpFile): boolean; {$ifndef FPC}far;{$endif}
|
||||||
|
function SearchExact(P: PIndexEntry): boolean; {$ifndef FPC}far;{$endif}
|
||||||
|
begin
|
||||||
|
SearchExact:=UpcaseStr(P^.Tag^)=Keyword;
|
||||||
|
end;
|
||||||
|
var P: PIndexEntry;
|
||||||
|
begin
|
||||||
|
H^.LoadIndex;
|
||||||
|
P:=H^.IndexEntries^.FirstThat(@SearchExact);
|
||||||
|
if P<>nil then begin FileID:=H^.ID; Context:=P^.HelpCtx; end;
|
||||||
|
ScanHelpFileExact:=P<>nil;
|
||||||
|
end;
|
||||||
function ScanHelpFile(H: PHelpFile): boolean; {$ifndef FPC}far;{$endif}
|
function ScanHelpFile(H: PHelpFile): boolean; {$ifndef FPC}far;{$endif}
|
||||||
function Search(P: PIndexEntry): boolean; {$ifndef FPC}far;{$endif}
|
function Search(P: PIndexEntry): boolean; {$ifndef FPC}far;{$endif}
|
||||||
begin
|
begin
|
||||||
@ -845,9 +857,14 @@ begin
|
|||||||
if P<>nil then begin FileID:=H^.ID; Context:=P^.HelpCtx; end;
|
if P<>nil then begin FileID:=H^.ID; Context:=P^.HelpCtx; end;
|
||||||
ScanHelpFile:=P<>nil;
|
ScanHelpFile:=P<>nil;
|
||||||
end;
|
end;
|
||||||
|
var
|
||||||
|
PH : PHelpFile;
|
||||||
begin
|
begin
|
||||||
Keyword:=UpcaseStr(Keyword);
|
Keyword:=UpcaseStr(Keyword);
|
||||||
TopicSearch:=HelpFiles^.FirstThat(@ScanHelpFile)<>nil;
|
PH:=HelpFiles^.FirstThat(@ScanHelpFileExact);
|
||||||
|
if not assigned(PH) then
|
||||||
|
PH:=HelpFiles^.FirstThat(@ScanHelpFile);
|
||||||
|
TopicSearch:=PH<>nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function THelpFacility.BuildIndexTopic: PTopic;
|
function THelpFacility.BuildIndexTopic: PTopic;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user