mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Fix small selection issues after uncomment
This commit is contained in:
parent
33204ff599
commit
fe9286f41c
1 changed files with 15 additions and 0 deletions
|
@ -2390,6 +2390,19 @@ namespace IDE.ui
|
||||||
return true;
|
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)
|
public bool ToggleComment(bool? doComment = null)
|
||||||
{
|
{
|
||||||
if (CheckReadOnly())
|
if (CheckReadOnly())
|
||||||
|
@ -2519,6 +2532,8 @@ namespace IDE.ui
|
||||||
if (prevSelection == null)
|
if (prevSelection == null)
|
||||||
mSelection = null;
|
mSelection = null;
|
||||||
|
|
||||||
|
FixSelection();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue