mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-21 01:18:02 +02:00
Fixed cursor up/down when there's a selection
This commit is contained in:
parent
6e869c5ac5
commit
905ccae64c
1 changed files with 8 additions and 4 deletions
|
@ -2366,7 +2366,14 @@ namespace Beefy.widgets
|
||||||
case KeyCode.Down:
|
case KeyCode.Down:
|
||||||
{
|
{
|
||||||
int32 aDir = (keyCode == KeyCode.Up) ? -1 : 1;
|
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);
|
GetCursorLineChar(out lineIdx, out lineChar);
|
||||||
|
|
||||||
|
@ -2403,9 +2410,6 @@ namespace Beefy.widgets
|
||||||
mCursorWantX = wantedX;
|
mCursorWantX = wantedX;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (didSelectionMove)
|
|
||||||
CursorToLineStart(false);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case KeyCode.Home:
|
case KeyCode.Home:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue