mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
ide: FindReplace return option
git-svn-id: svn://ultimatepp.org/upp/trunk@7507 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
27690b0058
commit
4d96328978
7 changed files with 54 additions and 32 deletions
|
|
@ -18,6 +18,7 @@ void CodeEditor::InitFindReplace()
|
|||
findreplace.find <<= findreplace.wholeword <<= findreplace.wildcards
|
||||
<<= findreplace.incremental <<= findreplace.regexp
|
||||
<<= findreplace.ignorecase <<= THISBACK(IncrementalFind);
|
||||
ff_restore_pos = -1;
|
||||
}
|
||||
|
||||
FindReplaceDlg::FindReplaceDlg()
|
||||
|
|
@ -514,7 +515,7 @@ void CodeEditor::OpenNormalFindReplace(bool replace)
|
|||
findreplace.itext = GetI();
|
||||
findreplace.prev.Show();
|
||||
findreplace.next <<= THISBACK(DoFind);
|
||||
findreplace.close <<= THISBACK(CloseFindReplace);
|
||||
findreplace.close <<= THISBACK(EscapeFindReplace);
|
||||
if(!findreplace.IsOpen())
|
||||
InsertFrame(FindFrame(sb), findreplace);
|
||||
WhenOpenFindReplace();
|
||||
|
|
@ -526,6 +527,8 @@ void CodeEditor::FindReplace(bool pick_selection, bool pick_text, bool replace)
|
|||
if(findreplace.IsOpen())
|
||||
CloseFindReplace();
|
||||
|
||||
ff_restore_pos = GetCursor();
|
||||
|
||||
replacei = 0;
|
||||
WString find_text;
|
||||
int find_pos = -1;
|
||||
|
|
@ -676,6 +679,15 @@ void CodeEditor::CloseFindReplace()
|
|||
}
|
||||
}
|
||||
|
||||
void CodeEditor::EscapeFindReplace()
|
||||
{
|
||||
CloseFindReplace();
|
||||
if(ff_restore_pos >= 0 && ff_restore_pos < GetLength() && findreplace.incremental && do_ff_restore_pos) {
|
||||
SetCursor(ff_restore_pos);
|
||||
ff_restore_pos = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void CodeEditor::IncrementalFind()
|
||||
{
|
||||
NoFindError();
|
||||
|
|
|
|||
Loading…
Reference in a new issue