static void PreviousWord (TextEditorData data, bool subword) { int oldLine = data.Caret.Line; int caretOffset = data.Caret.Offset; int offset = subword ? data.FindPrevSubwordOffset (caretOffset) : data.FindPrevWordOffset (caretOffset); if (caretOffset != offset && data.CanEdit (oldLine) && data.CanEdit (data.Caret.Line)) { data.Remove (offset, caretOffset - offset); } }
static void PreviousWord (TextEditorData data, bool subword) { int oldLine = data.Caret.Line; int offset = subword? data.FindPrevSubwordOffset (data.Caret.Offset) : data.FindPrevWordOffset (data.Caret.Offset); if (data.Caret.Offset != offset && data.CanEdit (oldLine) && data.CanEdit (data.Caret.Line)) { data.Remove (offset, data.Caret.Offset - offset); data.Caret.Offset = offset; if (oldLine != data.Caret.Line) data.Document.CommitLineToEndUpdate (data.Caret.Line); } }
static void PreviousWord(TextEditorData data, bool subword) { int oldLine = data.Caret.Line; int caretOffset = data.Caret.Offset; int offset = subword ? data.FindPrevSubwordOffset(caretOffset) : data.FindPrevWordOffset(caretOffset); if (caretOffset != offset && data.CanEdit(oldLine) && data.CanEdit(data.Caret.Line)) { data.Remove(offset, caretOffset - offset); } }
static void PreviousWord(TextEditorData data, bool subword) { int oldLine = data.Caret.Line; int offset = subword? data.FindPrevSubwordOffset(data.Caret.Offset) : data.FindPrevWordOffset(data.Caret.Offset); if (data.Caret.Offset != offset && data.CanEdit(oldLine) && data.CanEdit(data.Caret.Line)) { data.Remove(offset, data.Caret.Offset - offset); data.Caret.Offset = offset; if (oldLine != data.Caret.Line) { data.Document.CommitLineToEndUpdate(data.Caret.Line); } } }
public static void PreviousWord(TextEditorData data) { using (var undo = data.OpenUndoGroup()) { data.Caret.Offset = data.FindPrevWordOffset(data.Caret.Offset); } }
public static void PreviousWord (TextEditorData data) { data.Caret.Offset = data.FindPrevWordOffset (data.Caret.Offset); }
public static void PreviousWord(TextEditorData data) { data.Caret.Offset = data.FindPrevWordOffset(data.Caret.Offset); }
public static void PreviousWord (TextEditorData data) { using (var undo = data.OpenUndoGroup ()) { data.Caret.Offset = data.FindPrevWordOffset (data.Caret.Offset); } }