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

Fix small selection issues after uncomment

This commit is contained in:
Brian Fiete 2021-12-27 09:35:34 -05:00
parent 33204ff599
commit fe9286f41c

View file

@ -2390,6 +2390,19 @@ namespace IDE.ui
return true;
}
void FixSelection()
{
if (!HasSelection())
return;
if (CursorTextPos >= mSelection.Value.MaxPos)
CursorTextPos = mSelection.Value.MaxPos;
if (mSelection.Value.MaxPos - mSelection.Value.MinPos <= 1)
{
mSelection = null;
return;
}
}
public bool ToggleComment(bool? doComment = null)
{
if (CheckReadOnly())
@ -2519,6 +2532,8 @@ namespace IDE.ui
if (prevSelection == null)
mSelection = null;
FixSelection();
return true;
}