mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed copy text in read-only panels
This commit is contained in:
parent
76a8f2d7bb
commit
f008a98105
1 changed files with 24 additions and 27 deletions
|
@ -2003,35 +2003,32 @@ namespace Beefy.widgets
|
|||
|
||||
void CopyText(bool cut)
|
||||
{
|
||||
if (!CheckReadOnly())
|
||||
bool selectedLine = false;
|
||||
String extra = scope .();
|
||||
if (!HasSelection())
|
||||
{
|
||||
bool selectedLine = false;
|
||||
String extra = scope .();
|
||||
if (!HasSelection())
|
||||
{
|
||||
selectedLine = true;
|
||||
GetLinePosition(CursorLineAndColumn.mLine, var lineStart, var lineEnd);
|
||||
mSelection = .(lineStart, lineEnd);
|
||||
extra.Append("line");
|
||||
}
|
||||
|
||||
String selText = scope String();
|
||||
GetSelectionText(selText);
|
||||
BFApp.sApp.SetClipboardText(selText, extra);
|
||||
if (cut)
|
||||
{
|
||||
if (selectedLine)
|
||||
{
|
||||
// Remove \n
|
||||
if (mSelection.Value.mEndPos < mData.mTextLength)
|
||||
mSelection.ValueRef.mEndPos++;
|
||||
}
|
||||
DeleteSelection();
|
||||
}
|
||||
|
||||
if (selectedLine)
|
||||
mSelection = null;
|
||||
selectedLine = true;
|
||||
GetLinePosition(CursorLineAndColumn.mLine, var lineStart, var lineEnd);
|
||||
mSelection = .(lineStart, lineEnd);
|
||||
extra.Append("line");
|
||||
}
|
||||
|
||||
String selText = scope String();
|
||||
GetSelectionText(selText);
|
||||
BFApp.sApp.SetClipboardText(selText, extra);
|
||||
if ((cut) && (!CheckReadOnly()))
|
||||
{
|
||||
if (selectedLine)
|
||||
{
|
||||
// Remove \n
|
||||
if (mSelection.Value.mEndPos < mData.mTextLength)
|
||||
mSelection.ValueRef.mEndPos++;
|
||||
}
|
||||
DeleteSelection();
|
||||
}
|
||||
|
||||
if (selectedLine)
|
||||
mSelection = null;
|
||||
}
|
||||
|
||||
public void CutText()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue