1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 17:08:00 +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; int32 aDir = (keyCode == KeyCode.Up) ? -1 : 1;
if ((HasSelection()) && (!mWidgetWindow.IsKeyDown(KeyCode.Shift))) if ((HasSelection()) && (!mWidgetWindow.IsKeyDown(KeyCode.Shift)))
{ {
var lineAndCol = CursorLineAndColumn; if (mAllowVirtualCursor)
var usePos = (aDir < 0) ? (int32)mSelection.Value.MinPos : mSelection.Value.MaxPos; {
GetLineCharAtIdx(usePos, var selLine, var selLineChar); var lineAndCol = CursorLineAndColumn;
CursorLineAndColumn = .(selLine, lineAndCol.mColumn); var usePos = (aDir < 0) ? (int32)mSelection.Value.MinPos : mSelection.Value.MaxPos;
mSelection = null; GetLineCharAtIdx(usePos, var selLine, var selLineChar);
CursorLineAndColumn = .(selLine, lineAndCol.mColumn);
mSelection = null;
}
else
PrepareForCursorMove(aDir);
} }
GetCursorLineChar(out lineIdx, out lineChar); GetCursorLineChar(out lineIdx, out lineChar);