AppKit.TextKit.Formatter.LanguageFormatter.PreceedingCharacterIsWhitespaceOrTerminator C# (CSharp) Method

PreceedingCharacterIsWhitespaceOrTerminator() public method

Tests to see if the preceeding character is whitespace or terminator.
Returns true if at start of line.
public PreceedingCharacterIsWhitespaceOrTerminator ( string text, NSRange position ) : bool
text string The text to test.
position NSRange The current cursor position inside the text.
return bool
		public virtual bool PreceedingCharacterIsWhitespaceOrTerminator(string text, NSRange position) {
			var found = false;

			// At start of line?
			if (position.Location == 0) {
				// Yes, always true
				return true;
			}

			// Found?
			var c = text [(int)(position.Location - 1)];
			found = (c == ' ' | c == Newline || c == LineSeparator || c == ParagraphSeparator);

			// Return result
			return found;
		}