mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
ide: Fixed find in files history issue #824
git-svn-id: svn://ultimatepp.org/upp/trunk@8983 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c3ab15af3b
commit
6cce96db60
4 changed files with 32 additions and 5 deletions
|
|
@ -491,10 +491,11 @@ public:
|
|||
|
||||
struct FindReplaceData {
|
||||
String find, replace;
|
||||
String find_list, replace_list;
|
||||
bool wholeword, wildcards, ignorecase, samecase, regexp;
|
||||
};
|
||||
|
||||
FindReplaceData GetFindReplaceData() const;
|
||||
FindReplaceData GetFindReplaceData();
|
||||
void SetFindReplaceData(const FindReplaceData& d);
|
||||
|
||||
typedef CodeEditor CLASSNAME;
|
||||
|
|
@ -505,6 +506,9 @@ public:
|
|||
static void InitKeywords();
|
||||
};
|
||||
|
||||
String ReadList(WithDropChoice<EditString>& e);
|
||||
void WriteList(WithDropChoice<EditString>& e, const String& data);
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -817,7 +817,20 @@ void CodeEditor::SerializeFind(Stream& s)
|
|||
findreplace.replace.SerializeList(s);
|
||||
}
|
||||
|
||||
CodeEditor::FindReplaceData CodeEditor::GetFindReplaceData() const
|
||||
String ReadList(WithDropChoice<EditString>& e)
|
||||
{
|
||||
StringStream ss;
|
||||
e.SerializeList(ss);
|
||||
return ss;
|
||||
}
|
||||
|
||||
void WriteList(WithDropChoice<EditString>& e, const String& data)
|
||||
{
|
||||
StringStream ss(data);
|
||||
e.SerializeList(ss);
|
||||
}
|
||||
|
||||
CodeEditor::FindReplaceData CodeEditor::GetFindReplaceData()
|
||||
{
|
||||
FindReplaceData r;
|
||||
r.find = ~findreplace.find;
|
||||
|
|
@ -827,6 +840,8 @@ CodeEditor::FindReplaceData CodeEditor::GetFindReplaceData() const
|
|||
r.wildcards = ~findreplace.wildcards;
|
||||
r.samecase = ~findreplace.samecase;
|
||||
r.regexp = ~findreplace.regexp;
|
||||
r.find_list = ReadList(findreplace.find);
|
||||
r.replace_list = ReadList(findreplace.replace);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
@ -840,6 +855,8 @@ void CodeEditor::SetFindReplaceData(const FindReplaceData& r)
|
|||
findreplace.samecase <<= r.samecase;
|
||||
findreplace.regexp <<= r.regexp;
|
||||
findreplace.mode <<= 0;
|
||||
WriteList(findreplace.find, r.find_list);
|
||||
WriteList(findreplace.replace, r.replace_list);
|
||||
}
|
||||
|
||||
void CodeEditor::FindPrevNext(bool prev)
|
||||
|
|
|
|||
|
|
@ -243,20 +243,26 @@ void Ide::FindInFiles(bool replace) {
|
|||
(ff.wildcards, d.wildcards)
|
||||
(ff.regexp, d.regexp)
|
||||
;
|
||||
WriteList(ff.find, d.find_list);
|
||||
WriteList(ff.replace, d.replace_list);
|
||||
ff.Sync();
|
||||
if(String(ff.folder).IsEmpty())
|
||||
ff.folder <<= GetUppDir();
|
||||
ff.style <<= STYLE_NO_REPLACE;
|
||||
ff.Sync();
|
||||
ff.itext = editor.GetI();
|
||||
ff.Setup(replace);
|
||||
ff.Setup(replace);
|
||||
|
||||
int c = ff.Execute();
|
||||
|
||||
ff.find.AddHistory();
|
||||
ff.replace.AddHistory();
|
||||
|
||||
rf.Retrieve();
|
||||
d.find_list = ReadList(ff.find);
|
||||
d.replace_list = ReadList(ff.replace);
|
||||
editor.SetFindReplaceData(d);
|
||||
|
||||
|
||||
if(c == IDOK) {
|
||||
ffound.HeaderTab(2).SetText("Source line");
|
||||
Renumber();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "ide.h"
|
||||
|
||||
#define LLOG(x) DLOG(x)
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
void AssistEditor::SwapSContext(Parser& p)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue