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

Don't consider cursor in open space when in literal

This commit is contained in:
ESH 2025-02-07 13:00:12 +01:00
parent 60988fda8f
commit 7d8d6296ce

View file

@ -4193,8 +4193,10 @@ namespace IDE.ui
//int cursorTextPos = CursorTextPos;
if (cursorTextPos < mData.mTextLength)
{
charUnderCursor = (char8)mData.mText[cursorTextPos].mChar;
cursorInOpenSpace = ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace));
let charData = mData.mText[cursorTextPos];
let cursorInLiteral = (SourceElementType)charData.mDisplayTypeId == .Literal;
charUnderCursor = (char8)charData.mChar;
cursorInOpenSpace = ((!cursorInLiteral) && ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace)));
if (((keyChar == '(') && (charUnderCursor == ')')) ||
((keyChar == '[') && (charUnderCursor == ']')))
@ -4229,7 +4231,7 @@ namespace IDE.ui
}
else
{
if ((keyChar == '"') || (keyChar == '\''))
if ((!cursorInLiteral) && ((keyChar == '"') || (keyChar == '\'')))
cursorInOpenSpace = true;
}
}