public static GetWholeWord ( |
||
document | ||
textEditor | TextEditor | |
return | string |
private void _caret_PositionChanged(object sender, EventArgs e) { try { string currentWord = AvalonLoader.GetWholeWord(_textEditor.TextArea.Document, _textEditor); if (_textEditor.CaretOffset > 0) { if (currentWord.Length <= 0 || !char.IsLetterOrDigit(currentWord[0])) { foreach (char c in new char[] { '{', '}', '(', ')', '[', ']' }) { if (_isBefore(c) || _isAfter(c)) { currentWord = "" + c; } } } } if (_currentWord != currentWord) { _renderer.CurrentResults.Clear(); _textArea.TextView.InvalidateLayer(KnownLayer.Selection); } _currentWord = currentWord; _updateCurrentWord(currentWord); } catch { } }
private void _caret_PositionChanged(object sender, EventArgs e) { try { string currentWord = AvalonLoader.GetWholeWord(_textEditor.TextArea.Document, _textEditor); if (_currentWord != currentWord) { _renderer.CurrentResults.Clear(); _textArea.TextView.InvalidateLayer(KnownLayer.Selection); } _currentWord = currentWord; _updateCurrentWord(currentWord); } catch { } }