mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-12 05:14:10 +02:00
Initialize Find in Files with selected text
This commit is contained in:
parent
4efa88376c
commit
68ae9f4036
1 changed files with 25 additions and 0 deletions
|
@ -81,6 +81,31 @@ namespace IDE.ui
|
||||||
|
|
||||||
CreatePrevNextButtons();
|
CreatePrevNextButtons();
|
||||||
|
|
||||||
|
if (var editWidget = gApp.GetActiveWindow().mFocusWidget as EditWidget)
|
||||||
|
{
|
||||||
|
var content = editWidget.mEditWidgetContent;
|
||||||
|
int selStart = content.mSelection.Value.MinPos;
|
||||||
|
int selEnd = content.mSelection.Value.MaxPos;
|
||||||
|
bool isMultiline = false;
|
||||||
|
for (int i = selStart; i < selEnd; i++)
|
||||||
|
{
|
||||||
|
if (content.mData.mText[i].mChar == '\n')
|
||||||
|
{
|
||||||
|
isMultiline = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isMultiline)
|
||||||
|
{
|
||||||
|
var selText = scope String();
|
||||||
|
content.GetSelectionText(selText);
|
||||||
|
mEditWidget.SetText(selText);
|
||||||
|
mEditWidget.Content.SelectAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
UpdateUI();
|
UpdateUI();
|
||||||
//mEditWidget.mKeyDownHandler += EditKeyDownHandler;
|
//mEditWidget.mKeyDownHandler += EditKeyDownHandler;
|
||||||
//mEditWidget.mContentChangedHandler += (evt) => mFilterChanged = true;
|
//mEditWidget.mContentChangedHandler += (evt) => mFilterChanged = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue