mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
ide: replaced wildcard can now be uppercases/lowercased/initcapsed #456
git-svn-id: svn://ultimatepp.org/upp/trunk@5995 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
bc2f286219
commit
d48b9f24e1
1 changed files with 30 additions and 7 deletions
|
|
@ -291,35 +291,54 @@ WString CodeEditor::GetReplaceText(WString rs, bool wildcards, bool samecase)
|
|||
else
|
||||
if(c >= ' ') {
|
||||
if(wildcards) {
|
||||
WString w;
|
||||
if(c == '*')
|
||||
rt.Cat(GetWild(WILDANY, anyi));
|
||||
w = GetWild(WILDANY, anyi);
|
||||
else
|
||||
if(c == '?')
|
||||
rt.Cat(GetWild(WILDONE, onei));
|
||||
w = GetWild(WILDONE, onei);
|
||||
else
|
||||
if(c == '%')
|
||||
rt.Cat(GetWild(WILDSPACE, spacei));
|
||||
w = GetWild(WILDSPACE, spacei);
|
||||
else
|
||||
if(c == '#')
|
||||
rt.Cat(GetWild(WILDNUMBER, numberi));
|
||||
w = GetWild(WILDNUMBER, numberi);
|
||||
else
|
||||
if(c == '$')
|
||||
rt.Cat(GetWild(WILDID, idi));
|
||||
w = GetWild(WILDID, idi);
|
||||
else
|
||||
if(c == '@') {
|
||||
c = *s++;
|
||||
if(c == '\0') break;
|
||||
if(c >= '1' && c <= '9') {
|
||||
c -= '1';
|
||||
rt.Cat(c < foundwild.GetCount() ? foundwild[c].text : WString());
|
||||
w = c < foundwild.GetCount() ? foundwild[c].text : WString();
|
||||
}
|
||||
else {
|
||||
rt.Cat('@');
|
||||
if(c >= ' ' && c < 255) rt.Cat(c);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
rt.Cat(c);
|
||||
continue;
|
||||
}
|
||||
if(*s == '+') {
|
||||
w = ToUpper(w);
|
||||
s++;
|
||||
}
|
||||
else
|
||||
if(*s == '-') {
|
||||
w = ToLower(w);
|
||||
s++;
|
||||
}
|
||||
else
|
||||
if(*s == '!') {
|
||||
w = InitCaps(w);
|
||||
s++;
|
||||
}
|
||||
rt.Cat(w);
|
||||
}
|
||||
else
|
||||
rt.Cat(c);
|
||||
|
|
@ -520,6 +539,10 @@ void CodeEditor::ReplaceWildcard()
|
|||
for(int i = 1; i <= 9; i++)
|
||||
menu.Add(Format("Matched wildcard %d", i), THISBACK1(InsertWildcard, i));
|
||||
menu.Separator();
|
||||
menu.Add("To upper", THISBACK1(InsertWildcard, '+'));
|
||||
menu.Add("To lower", THISBACK1(InsertWildcard, '-'));
|
||||
menu.Add("InitCaps", THISBACK1(InsertWildcard, '!'));
|
||||
menu.Separator();
|
||||
menu.Add("Tab", THISBACK1(InsertWildcard, 20));
|
||||
menu.Add("Line feed", THISBACK1(InsertWildcard, 21));
|
||||
int l, h;
|
||||
|
|
|
|||
Loading…
Reference in a new issue