mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
CodeEditor: Find next now finds current selection if any #982
git-svn-id: svn://ultimatepp.org/upp/trunk@8171 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
1e3d3f95e0
commit
22383f7a4b
1 changed files with 21 additions and 4 deletions
|
|
@ -602,10 +602,14 @@ void CodeEditor::FindReplace(bool pick_selection, bool pick_text, bool replace)
|
|||
|
||||
if(pick_text || pick_selection)
|
||||
{
|
||||
WString s = GetSelection().ToWString();
|
||||
if(IsSelection()) {
|
||||
if(s.Find('\n') < 0)
|
||||
find_text = s;
|
||||
int l, h;
|
||||
GetSelection(l, h);
|
||||
if(h - l < 100) {
|
||||
find_text = GetSelectionW();
|
||||
if(find_text.Find('\n') >= 0)
|
||||
find_text.Clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
if(pick_text) {
|
||||
|
|
@ -837,8 +841,21 @@ void CodeEditor::SetFindReplaceData(const FindReplaceData& r)
|
|||
|
||||
void CodeEditor::FindPrevNext(bool prev)
|
||||
{
|
||||
if(!findreplace.IsOpen())
|
||||
if(!findreplace.IsOpen()) {
|
||||
WString find_text;
|
||||
if(IsSelection()) {
|
||||
int l, h;
|
||||
GetSelection(l, h);
|
||||
if(h - l < 100) {
|
||||
find_text = GetSelectionW();
|
||||
if(find_text.Find('\n') >= 0)
|
||||
find_text.Clear();
|
||||
}
|
||||
}
|
||||
if(find_text.GetCount())
|
||||
findreplace.find <<= find_text;
|
||||
OpenNormalFindReplace0(false);
|
||||
}
|
||||
if(Find(prev, false))
|
||||
NoFindError();
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue