From 2926828c976b612aab6b7d5f264cbb02bb43baaa Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 10 Jan 2004 01:31:13 +0000 Subject: [PATCH] tab completion is now case sensitive git-svn-id: trunk@5039 - --- ide/uniteditor.pp | 2 +- ide/wordcompletion.pp | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ide/uniteditor.pp b/ide/uniteditor.pp index 6d618dfbc3..342c7f3b12 100644 --- a/ide/uniteditor.pp +++ b/ide/uniteditor.pp @@ -2340,7 +2340,7 @@ begin ctWordCompletion: begin - aWordCompletion.CompletePrefix(OldPrefix,NewPrefix,false); + aWordCompletion.CompletePrefix(OldPrefix,NewPrefix); end; end; diff --git a/ide/wordcompletion.pp b/ide/wordcompletion.pp index bb7e0cca09..c084296bb9 100644 --- a/ide/wordcompletion.pp +++ b/ide/wordcompletion.pp @@ -47,8 +47,7 @@ type read GetWordBufferCapacity write SetWordBufferCapacity; procedure GetWordList(AWordList:TStrings; const Prefix:String; CaseSensitive:boolean; MaxResults:integer); - procedure CompletePrefix(const Prefix: string; var CompletedPrefix: string; - CaseSensitive:boolean); + procedure CompletePrefix(const Prefix: string; var CompletedPrefix: string); public property OnGetSource:TWordCompletionGetSource read FOnGetSource write FOnGetSource; @@ -198,7 +197,7 @@ begin end; procedure TWordCompletion.CompletePrefix(const Prefix: string; - var CompletedPrefix: string; CaseSensitive: boolean); + var CompletedPrefix: string); var WordList: TStringList; s: string; @@ -210,7 +209,7 @@ begin WordList:=TStringList.Create; try // fetch all words with Prefix - GetWordList(WordList,Prefix,CaseSensitive,10000); + GetWordList(WordList,Prefix,true,10000); if WordList.Count=0 then exit; // find the biggest prefix of all available words CompletedPrefix:=WordList[0]; @@ -224,13 +223,8 @@ begin MaxPos:=length(s); if MaxPos>length(CompletedPrefix) then MaxPos:=length(CompletedPrefix); while (SamePosCompletedPrefix[SamePos+1] then - break; - end else begin - if upcase(s[SamePos+1])<>upcase(CompletedPrefix[SamePos+1]) then - break; - end; + if s[SamePos+1]<>CompletedPrefix[SamePos+1] then + break; inc(SamePos); end; if SamePos