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

Fix for Up/Down with selection without mAllowVirtualCursor

This commit is contained in:
Brian Fiete 2021-12-28 10:42:34 -05:00
parent 190e52ae2e
commit 1ac5992d8e

View file

@ -2368,11 +2368,16 @@ namespace Beefy.widgets
int32 aDir = (keyCode == KeyCode.Up) ? -1 : 1;
if ((HasSelection()) && (!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;
if (mAllowVirtualCursor)
{
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;
}
else
PrepareForCursorMove(aDir);
}
GetCursorLineChar(out lineIdx, out lineChar);