public static FindNextInLine ( string searchText, int offset, char c ) : int | ||
searchText | string | |
offset | int | |
c | char | |
Résultat | int |
protected void ChangeInside(char start, char end) { if (Editor.Text[Editor.Caret.Offset] != start) { return; } // FIXME: should not be restricted inside a line // FIXME: should find the *matching* character, not next int offset = StringUtils.FindNextInLine(Editor.Text, Editor.Caret.Offset, end); if (offset <= 0) { return; } CaretMoveActions.Right(Editor); if (Editor.Caret.Offset < offset) { Editor.SetSelection(Editor.Caret.Offset, offset); ClipboardActions.Cut(Editor); } RequestedMode = Mode.Insert; }
protected override void Run() { for (int i = 0; i < Count; i++) { var offset = StringUtils.FindNextInLine(Editor.Text, Editor.Caret.Offset, Argument); if (offset <= 0) { return; } Editor.Caret.Offset = offset; } }
protected override void Run() { for (int i = 0; i < Count; i++) { int start = Editor.Caret.Offset; var end = StringUtils.FindNextInLine(Editor.Text, Editor.Caret.Offset, Argument); if (end <= 0) { return; } end += findResultShift; Editor.SetSelection(start, end); ClipboardActions.Cut(Editor); } }
protected override void Run() { var originalCaretPosition = Editor.Caret.Offset; for (int i = 0; i < Count; i++) { var offset = StringUtils.FindNextInLine(Editor.Text, Editor.Caret.Offset, Argument); if (offset <= 0) { return; } Editor.Caret.Offset = offset; Editor.SetSelection(originalCaretPosition, offset); } Editor.Caret.Offset += findResultShift; }