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

Make CommentBlock work when selection ends with ws at line start

This commit is contained in:
Brian Fiete 2021-12-21 17:14:17 -05:00
parent 688d1f8dd1
commit 8ff8ff0df1

View file

@ -2272,6 +2272,38 @@ namespace IDE.ui
break;
minPos--;
}
bool hadMaxChar = false;
int checkMaxPos = maxPos;
while (checkMaxPos > 0)
{
var c = mData.mText[checkMaxPos - 1].mChar;
if (c == '\n')
break;
if ((c != '\t') && (c != ' '))
{
hadMaxChar = true;
break;
}
checkMaxPos--;
}
if (!hadMaxChar)
{
checkMaxPos = maxPos;
while (checkMaxPos < mData.mTextLength)
{
var c = mData.mText[checkMaxPos].mChar;
if (c == '\n')
break;
if ((c != '\t') && (c != ' '))
{
maxPos = checkMaxPos + 1;
break;
}
checkMaxPos++;
}
}
int wantLineCol = -1;
int lineStartCol = 0;