コード例 #1
0
        public IndentState ResetBaseIndent(string baseIndent) {
            IndentState indentState = new IndentState(IndentLevel, _indentStrings);

            IndentLevel = 0;

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

            return indentState;
        }
コード例 #2
0
 public void RestoreIndentState(IndentState indentState) {
     IndentLevel = indentState.IndentLevel;
     _indentStrings = indentState.IndentStrings;
 }
コード例 #3
0
ファイル: IndentBuilder.cs プロジェクト: Fooway/RTVS
 public void RestoreIndentState(IndentState indentState)
 {
     IndentLevel    = indentState.IndentLevel;
     _indentStrings = indentState.IndentStrings;
 }
コード例 #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);
            }
        }