Text Navigation in WPF Syntax Editor
18 Oct 20223 minutes to read
Syntax Editor offers extensive support to text navigation. Users can perform navigation between characters, words, and line items using the built-in functions or keyboard shortcut keys.
Programmatic Navigation
Character based navigation
The following functions enables text navigation in the Syntax Editor in terms of characters or columns.
-
MoveToPreviousIndex to move cursor position in backward position.
-
MoveToNextIndex to move cursor position in forward position in .
//To move cursor to previous index this.editControl.MoveToPreviousIndex();
//To move cursor to previous index Me.editControl.MoveToPreviousIndex()
Word based navigation
The following functions enables text navigation in the Syntax Editor in terms of words.
-
MoveToNextWord moves cursor to start position of next word.
-
MoveToPreviousWord moves cursor to start position of previous word.
//To move cursor to next word this.editControl.MoveToNextWord();
//To move cursor to next word Me.editControl.MoveToPreviousWord()
Line based navigation
The following functions enables text navigation in the Syntax Editor in terms of lines.
-
MoveToNextLine to move cursor to same position on next line.
-
MoveToPreviousLine to move cursor to same position on previous line.
-
MoveToLineStart to move cursor to start postion of current line.
-
MoveToLineEnd to move cursor to end postion of current line.
//To move cursor to next line this.editControl.MoveToNextLine();
//To move cursor to next line Me.editControl.MoveToNextLine()
Keyboard Navigation
The following keyboard shortcuts are supported for cursor navigation in Syntax Editor.
Navigation Shortcut Keys |
Descriptions |
Right arrow |
Moves the cursor to a position forward in the current line item. |
Left arrow |
Moves the cursor to the end position of the current line item. |
Down arrow |
Moves the cursor to the same position on the next line item. |
Up arrow |
Moves the cursor to the same position on the previous line item. |
Home |
Moves the cursor to the start position of the current line item. |
End |
Moves the cursor to the end position of the current line item. |
Ctrl + Right arrow |
Moves the cursor to the start position of the next word. |
Ctrl + Left arrow |
Moves the cursor to the start position of the previous word. |
Ctrl + Home |
Moves the cursor to the document start position. |
Ctrl + End |
Moves the cursor to the end position of document. |