mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Don't unindent when typing ':' in multiline string literal
This commit is contained in:
parent
2b848a275c
commit
c6ca4c8bb4
1 changed files with 13 additions and 1 deletions
|
@ -3667,6 +3667,7 @@ namespace IDE.ui
|
|||
if ((keyChar.IsLower) || (keyChar == ' ') || (keyChar == ':'))
|
||||
{
|
||||
int cursorTextIdx = CursorTextPos;
|
||||
|
||||
int line;
|
||||
int lineChar;
|
||||
GetLineCharAtIdx(cursorTextIdx, out line, out lineChar);
|
||||
|
@ -3678,10 +3679,21 @@ namespace IDE.ui
|
|||
|
||||
if ((keyChar == ' ') || (keyChar == ':'))
|
||||
{
|
||||
BfSourceElementType elementType = .Normal;
|
||||
GetLinePosition(line, var lineStart, var lineEnd);
|
||||
for (int idx in lineStart..<lineEnd)
|
||||
{
|
||||
if (!mData.mText[idx].mChar.IsWhiteSpace)
|
||||
{
|
||||
elementType = (.)mData.mText[idx].mDisplayTypeId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool isLabel = false;
|
||||
if (keyChar == ':')
|
||||
{
|
||||
isLabel = trimmedLineText != "scope:";
|
||||
isLabel = (trimmedLineText != "scope:") && (elementType != .Literal);
|
||||
for (var c in trimmedLineText.RawChars)
|
||||
{
|
||||
if (c.IsWhiteSpace)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue