mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue