|
|
|
@ -610,7 +610,8 @@ namespace VBNetBinding.FormattingStrategy
@@ -610,7 +610,8 @@ namespace VBNetBinding.FormattingStrategy
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (IsBlockStart(lexer, currentToken, prevToken)) { |
|
|
|
|
ApplyToRange(textArea, indentation, oldLine, currentToken.Location.Line, begin, end); |
|
|
|
|
int line = GetLastVisualLine(currentToken.Location.Line, textArea); |
|
|
|
|
ApplyToRange(textArea, indentation, oldLine, line, begin, end); |
|
|
|
|
|
|
|
|
|
if (!inInterface && !isMustOverride && !isDeclare && !isDelegate) { |
|
|
|
|
Indent(textArea, indentation); |
|
|
|
@ -622,7 +623,7 @@ namespace VBNetBinding.FormattingStrategy
@@ -622,7 +623,7 @@ namespace VBNetBinding.FormattingStrategy
|
|
|
|
|
if (currentToken.Kind == Tokens.Interface) |
|
|
|
|
inInterface = true; |
|
|
|
|
|
|
|
|
|
oldLine = currentToken.Location.Line; |
|
|
|
|
oldLine = line; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
prevToken = currentToken; |
|
|
|
@ -638,6 +639,16 @@ namespace VBNetBinding.FormattingStrategy
@@ -638,6 +639,16 @@ namespace VBNetBinding.FormattingStrategy
|
|
|
|
|
|
|
|
|
|
return indentation.Peek().Length; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int GetLastVisualLine(int line, TextArea area) |
|
|
|
|
{ |
|
|
|
|
string text = StripComment(area.Document.GetText(area.Document.GetLineSegment(line - 1))); |
|
|
|
|
while (text.EndsWith("_", StringComparison.Ordinal)) { |
|
|
|
|
line++; |
|
|
|
|
text = StripComment(area.Document.GetText(area.Document.GetLineSegment(line - 1))); |
|
|
|
|
} |
|
|
|
|
return line; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Unindent(Stack<string> indentation) |
|
|
|
|
{ |
|
|
|
|