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

Fixed cursor up/down when there's a selection

This commit is contained in:
Brian Fiete 2021-12-27 06:17:14 -05:00
parent 6e869c5ac5
commit 905ccae64c

View file

@ -2366,7 +2366,14 @@ namespace Beefy.widgets
case KeyCode.Down:
{
int32 aDir = (keyCode == KeyCode.Up) ? -1 : 1;
bool didSelectionMove = PrepareForCursorMove(aDir);
if ((mSelection != null) && (!mWidgetWindow.IsKeyDown(KeyCode.Shift)))
{
var lineAndCol = CursorLineAndColumn;
var usePos = (aDir < 0) ? (int32)mSelection.Value.MinPos : mSelection.Value.MaxPos;
GetLineCharAtIdx(usePos, var selLine, var selLineChar);
CursorLineAndColumn = .(selLine, lineAndCol.mColumn);
mSelection = null;
}
GetCursorLineChar(out lineIdx, out lineChar);
@ -2403,9 +2410,6 @@ namespace Beefy.widgets
mCursorWantX = wantedX;
}
if (didSelectionMove)
CursorToLineStart(false);
}
break;
case KeyCode.Home: