Ejemplo n.º 1
0
        public IndentState ResetBaseIndent(string baseIndent) {
            IndentState indentState = new IndentState(IndentLevel, _indentStrings);

            IndentLevel = 0;

            _indentStrings = new List<string>();
            _indentStrings.Add(baseIndent);

            return indentState;
        }
Ejemplo n.º 2
0
 public void RestoreIndentState(IndentState indentState) {
     IndentLevel = indentState.IndentLevel;
     _indentStrings = indentState.IndentStrings;
 }
Ejemplo n.º 3
0
 public void RestoreIndentState(IndentState indentState)
 {
     IndentLevel    = indentState.IndentLevel;
     _indentStrings = indentState.IndentStrings;
 }
Ejemplo n.º 4
0
        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);
            }
        }