SuggestCtrl: JustStart, ide: builder improvements

git-svn-id: svn://ultimatepp.org/upp/trunk@8046 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-01-16 15:33:23 +00:00
parent 0f4856ea28
commit f03da91ced
5 changed files with 18 additions and 4 deletions

View file

@ -93,9 +93,11 @@ bool SuggestCtrl::Key(dword key, int count)
int h;
WString x = CF(ReadLast(h));
list.Clear();
for(int i = 0; i < data.GetCount(); i++)
if(CF(data[i]).Find(x) >= 0)
for(int i = 0; i < data.GetCount(); i++) {
WString h = CF(data[i]);
if(just_start ? h.StartsWith(x) : h.Find(x) >= 0)
list.Add(data[i]);
}
if(list.GetCount() == 0) {
Cancel();
return true;
@ -154,6 +156,7 @@ SuggestCtrl::SuggestCtrl()
delimiter_filter = NULL;
droplines = 16;
compare_filter = NULL;
just_start = false;
}
END_UPP_NAMESPACE

View file

@ -11,6 +11,7 @@ private:
int delimiter_char;
int (*delimiter_filter)(int c);
int (*compare_filter)(int c);
bool just_start;
void Cancel();
void Select();
@ -32,6 +33,7 @@ public:
SuggestCtrl& Delimiter(int chr) { delimiter_char = chr; return *this; }
SuggestCtrl& Delimiter(int (*filter)(int c)) { delimiter_filter = filter; return *this; }
SuggestCtrl& CompareFilter(int (*filter)(int c)) { compare_filter = filter; return *this; }
SuggestCtrl& JustStart(bool b = true) { just_start = b; return *this; }
SuggestCtrl();
};

View file

@ -66,4 +66,10 @@ change `',`' to `';`') before it is written to the text.&]
]_[* CompareFilter]([@(0.0.255) int]_(`*[*@3 filter])([@(0.0.255) int]_c))&]
[s2;%% Sets filter to be applied to text and to the suggestions before
it is compared while searching for suggestions.&]
[s3;%% &]
[s4; &]
[s5;:SuggestCtrl`:`:JustStart`(bool`): [_^SuggestCtrl^ SuggestCtrl][@(0.0.255) `&]_[* JustS
tart]([@(0.0.255) bool]_[*@3 b]_`=_[@(0.0.255) true])&]
[s2;%% Only matches the starts of suggestions.&]
[s3;%% &]
[s0;%% ]]

View file

@ -6,7 +6,8 @@ uses
ide\Core;
file
Builders.h options PCH,
Builders.h
options() PCH,
CppBuilder.cpp,
MakeFile.cpp,
GccBuilder.icpp,

View file

@ -323,6 +323,8 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
}
if(pkg[i].noblitz)
noblitz.Add(fn);
if(ext == ".c")
nopch.Add(fn);
}
}
}
@ -337,7 +339,7 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
for(i = 0; i < sfile.GetCount(); i++) {
String fn = sfile[i];
String ext = ToLower(GetFileExt(fn));
if(findarg(ext, ".rc", ".brc") < 0 && HdependFileTime(sfile[i]) > GetFileTime(CatAnyPath(outdir, GetFileTitle(fn) + ".obj")))
if(findarg(ext, ".rc", ".brc", ".c") < 0 && HdependFileTime(sfile[i]) > GetFileTime(CatAnyPath(outdir, GetFileTitle(fn) + ".obj")))
recompile++;
}