mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Merge pull request #2132 from m910q/fix_auto_closing_tags_in_string_literal
Don't consider cursor in open space when in literal
This commit is contained in:
commit
856490755e
1 changed files with 5 additions and 3 deletions
|
@ -4193,8 +4193,10 @@ namespace IDE.ui
|
||||||
//int cursorTextPos = CursorTextPos;
|
//int cursorTextPos = CursorTextPos;
|
||||||
if (cursorTextPos < mData.mTextLength)
|
if (cursorTextPos < mData.mTextLength)
|
||||||
{
|
{
|
||||||
charUnderCursor = (char8)mData.mText[cursorTextPos].mChar;
|
let charData = mData.mText[cursorTextPos];
|
||||||
cursorInOpenSpace = ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace));
|
let cursorInLiteral = (SourceElementType)charData.mDisplayTypeId == .Literal;
|
||||||
|
charUnderCursor = (char8)charData.mChar;
|
||||||
|
cursorInOpenSpace = ((!cursorInLiteral) && ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace)));
|
||||||
|
|
||||||
if (((keyChar == '(') && (charUnderCursor == ')')) ||
|
if (((keyChar == '(') && (charUnderCursor == ')')) ||
|
||||||
((keyChar == '[') && (charUnderCursor == ']')))
|
((keyChar == '[') && (charUnderCursor == ']')))
|
||||||
|
@ -4229,7 +4231,7 @@ namespace IDE.ui
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((keyChar == '"') || (keyChar == '\''))
|
if ((!cursorInLiteral) && ((keyChar == '"') || (keyChar == '\'')))
|
||||||
cursorInOpenSpace = true;
|
cursorInOpenSpace = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue