mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 16:40:26 +02:00
Added Ctrl+Backspace support for deleting text span
This commit is contained in:
parent
b128180a15
commit
ea072ad77b
3 changed files with 80 additions and 50 deletions
|
@ -2061,7 +2061,23 @@ namespace IDE.ui
|
|||
|
||||
var keyChar;
|
||||
if (keyChar == '\x7F') // Ctrl+Backspace
|
||||
keyChar = '\b';
|
||||
{
|
||||
int line;
|
||||
int lineChar;
|
||||
GetCursorLineChar(out line, out lineChar);
|
||||
|
||||
int startIdx = CursorTextPos;
|
||||
SelectLeft(line, lineChar, true, false);
|
||||
mSelection = EditSelection(CursorTextPos, startIdx);
|
||||
|
||||
var action = new DeleteSelectionAction(this);
|
||||
action.mMoveCursor = true;
|
||||
mData.mUndoManager.Add(action);
|
||||
action.mCursorTextPos = (.)startIdx;
|
||||
PhysDeleteSelection(true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (mIgnoreKeyChar)
|
||||
{
|
||||
|
|
|
@ -2471,8 +2471,12 @@ namespace IDE.ui
|
|||
if (startContentIdx == -1)
|
||||
{
|
||||
lineLeft = trackedElementView.mTextPosition.mIndex;
|
||||
|
||||
repeat
|
||||
{
|
||||
if (lineLeft >= editContent.mData.mTextLength)
|
||||
break;
|
||||
|
||||
if (!((char8)editContent.mData.mText[lineLeft].mChar).IsWhiteSpace)
|
||||
{
|
||||
startContentIdx = lineLeft;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue