public IndentState ResetBaseIndent(string baseIndent) { IndentState indentState = new IndentState(IndentLevel, _indentStrings); IndentLevel = 0; _indentStrings = new List<string>(); _indentStrings.Add(baseIndent); return indentState; }
public void RestoreIndentState(IndentState indentState) { IndentLevel = indentState.IndentLevel; _indentStrings = indentState.IndentStrings; }
private void CompareAndSetIndent(ITextProvider textProvider, TokenStream<RToken> tokens, int position, RFormatOptions options) { // If curly is on its own line (there is only whitespace between line break // and the curly, find out its current indent and if it is deeper than // the default one, use it, otherwise continue with default. string userIndentString = GetUserIndentString(textProvider, position, options); int defaultIndentSize = _indentBuilder.IndentLevelString.Length; if (userIndentString.Length > defaultIndentSize) { _previousState = _indentBuilder.ResetBaseIndent(userIndentString); } }