1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed Ctrl+Backspace, fixed muiltiline clipping paste-then-undo error

This commit is contained in:
Brian Fiete 2020-04-10 08:57:45 -07:00
parent e62104a7d1
commit 5879469933
2 changed files with 13 additions and 9 deletions

View file

@ -1074,13 +1074,6 @@ namespace Beefy.widgets
bool atEnd = textPos == mData.mTextLength;
String insertStr = text;
if (!mIsMultiline)
{
int crPos = insertStr.IndexOf('\n');
if (crPos != -1)
insertStr = scope:: String(text, 0, crPos);
}
InsertText((int32)textPos, insertStr);
if (atEnd)
@ -1130,11 +1123,15 @@ namespace Beefy.widgets
{
scope AutoBeefPerf("EWC.InsertAtCursor");
//String insertText = scope String();
String insertString = theString;
if (!mIsMultiline)
{
int crPos = insertString.IndexOf('\n');
if (crPos != -1)
insertString = scope:: String(theString, 0, crPos);
}
bool doCheck = true;
@ -1669,6 +1666,9 @@ namespace Beefy.widgets
mCursorBlinkTicks = 0;
if (useChar == '\x7F') // Ctrl+Backspace
useChar = '\b';
if (useChar == '\b')
{
if (!CheckReadOnly())

View file

@ -2059,6 +2059,10 @@ namespace IDE.ui
{
scope AutoBeefPerf("SEWC.KeyChar");
var keyChar;
if (keyChar == '\x7F') // Ctrl+Backspace
keyChar = '\b';
if (mIgnoreKeyChar)
{
mIgnoreKeyChar = false;