ARCed.Scripting.ScriptEditorForm.GetLineIndent C# (CSharp) Метод

GetLineIndent() приватный Метод

Return the required indent for this line or -1 if the line is a multiline comment or string
private GetLineIndent ( Line line ) : int
line Line
Результат int
		private int GetLineIndent(Line line)
		{
			int pos = line.StartPosition - 1;
			this._scintilla.NativeInterface.Colourise(pos, pos + 1); // styles are used to determine indent so we must load them before proceeding
			int style = this._scintilla.Styles.GetStyleAt(pos);
			if (style == 3 || style == 6 || style == 7 || style == 12 || style == 18 || line.Text.StartsWith("=begin"))
				return -1;
			int indent = line.FoldLevel - 1024;
			string w1 = this._scintilla.GetWordFromPosition(line.IndentPosition);
			string w2 = this._scintilla.CharAt(line.IndentPosition).ToString();
			if (_unindentWords.Contains(w1) || _unindentWords.Contains(w2))
				indent--;
			return indent;
		}