1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-26 19:48:01 +02:00

InsertCharPair fix for start-of-line insertions

This commit is contained in:
Brian Fiete 2024-02-24 08:54:57 -05:00
parent fa019f03bf
commit 59f2451cf9

View file

@ -3781,8 +3781,8 @@ namespace IDE.ui
void InsertCharPair(String charPair)
{
mCurParenPairIdSet.Add(mData.mNextCharId);
base.InsertCharPair(charPair);
mCurParenPairIdSet.Add(mData.mNextCharId - 2);
}
public override void KeyChar(char32 keyChar)
@ -4156,20 +4156,20 @@ namespace IDE.ui
if (prevElementType != SourceElementType.Comment)
{
doChar = false;
char8 char8UnderCursor = (char8)0;
char8 charUnderCursor = (char8)0;
bool cursorInOpenSpace = false;
//int cursorTextPos = CursorTextPos;
if (cursorTextPos < mData.mTextLength)
{
char8UnderCursor = (char8)mData.mText[cursorTextPos].mChar;
cursorInOpenSpace = ((char8UnderCursor == ')') || (char8UnderCursor == ']') || (char8UnderCursor == ';') || (char8UnderCursor == (char8)0) || (char8UnderCursor.IsWhiteSpace));
charUnderCursor = (char8)mData.mText[cursorTextPos].mChar;
cursorInOpenSpace = ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace));
if (((keyChar == '(') && (char8UnderCursor == ')')) ||
((keyChar == '[') && (char8UnderCursor == ']')))
if (((keyChar == '(') && (charUnderCursor == ')')) ||
((keyChar == '[') && (charUnderCursor == ']')))
cursorInOpenSpace = IsCurrentPairClosing(cursorTextPos);
if ((char8UnderCursor == keyChar) && (!HasSelection()))
if ((charUnderCursor == keyChar) && (!HasSelection()))
{
var wantElementType = SourceElementType.Normal;