SELECTION

Caret movement, selection extension, and selection control commands executed via editor.execCommand.

Commands


command - blurIme

Removes focus from the editor.

NameTypeDescription
actionNamestringAction name
editor.execCommand('blurIme');

command - disableIme

Disables text input.

NameTypeDescription
actionNamestringAction name
editor.execCommand('disableIme');

command - documentEnd

Moves the caret to the end of the document.

NameTypeDescription
actionNamestringAction name
editor.execCommand('documentEnd');

command - documentStart

Moves the caret to the start of the document.

NameTypeDescription
actionNamestringAction name
editor.execCommand('documentStart');

command - down

Moves the caret down.

NameTypeDescription
actionNamestringAction name
editor.execCommand('down');

command - enableIme

Enables text input.

NameTypeDescription
actionNamestringAction name
editor.execCommand('enableIme');

command - extendCol

Selects the column at the given index in the table identified by tableId.

NameTypeDescription
actionNamestringAction name
tableIdstringTable id
indexnumberColumn index
isExtendbooleanWhether to extend the existing selection
editor.execCommand('extendCol', 'table_id', 0, false);

command - extendDocumentEnd

Extends the selection to the end of the document.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendDocumentEnd');

command - extendDocumentStart

Extends the selection to the start of the document.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendDocumentStart');

command - extendDown

Extends the selection downward.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendDown');

command - extendLeft

Extends the selection one position to the left.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendLeft');

command - extendLineEnd

Extends the selection to the end of the line.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendLineEnd');

command - extendLineStart

Extends the selection to the start of the line.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendLineStart');

command - extendNextParagraphStart

Extends the selection to the start of the next paragraph.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendNextParagraphStart');

command - extendNextWord

Extends the selection to the start of the next word.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendNextWord');

command - extendPageDown

Extends the selection down by one scroll page.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendPageDown');

command - extendPageUp

Extends the selection up by one scroll page.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendPageUp');

command - extendPreviousParagraphStart

Extends the selection to the start of the previous paragraph.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendPreviousParagraphStart');

command - extendPreviousWord

Extends the selection to the start of the previous word.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendPreviousWord');

command - extendRight

Extends the selection one position to the right.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendRight');

command - extendRow

Selects the row at the given index in the table identified by tableId.

NameTypeDescription
actionNamestringAction name
tableIdstringTable id
indexnumberRow index
isExtendbooleanWhether to extend the existing selection
editor.execCommand('extendRow', 'table_id', 0, false);

command - extendTable

Selects the entire table identified by tableId.

NameTypeDescription
actionNamestringAction name
tableIdstringTable id
editor.execCommand('extendTable', 'table_id');

command - extendUp

Extends the selection upward.

NameTypeDescription
actionNamestringAction name
editor.execCommand('extendUp');

command - focusIme

Moves focus to the editor.

NameTypeDescription
actionNamestringAction name
preventScrollbooleanWhether to skip scrolling to the selection (default false)
editor.execCommand('focusIme', false);  // scroll to the selection
editor.execCommand('focusIme', true);   // do not scroll

command - left

Moves the caret one position to the left.

NameTypeDescription
actionNamestringAction name
editor.execCommand('left');

command - lineEnd

Moves the caret to the end of the line.

NameTypeDescription
actionNamestringAction name
editor.execCommand('lineEnd');

command - lineStart

Moves the caret to the start of the line.

NameTypeDescription
actionNamestringAction name
editor.execCommand('lineStart');

command - nextParagraphStart

Moves the caret to the start of the next paragraph.

NameTypeDescription
actionNamestringAction name
editor.execCommand('nextParagraphStart');

command - nextWord

Moves the caret to the start of the next word.

NameTypeDescription
actionNamestringAction name
editor.execCommand('nextWord');

command - pageDown

Moves the caret down by one scroll page.

NameTypeDescription
actionNamestringAction name
editor.execCommand('pageDown');

command - pageUp

Moves the caret up by one scroll page.

NameTypeDescription
actionNamestringAction name
editor.execCommand('pageUp');

command - previousParagraphStart

Moves the caret to the start of the previous paragraph.

NameTypeDescription
actionNamestringAction name
editor.execCommand('previousParagraphStart');

command - previousWord

Moves the caret to the start of the previous word.

NameTypeDescription
actionNamestringAction name
editor.execCommand('previousWord');

command - right

Moves the caret one position to the right.

NameTypeDescription
actionNamestringAction name
editor.execCommand('right');

command - selectAll

Selects the entire document.

NameTypeDescription
actionNamestringAction name
editor.execCommand('selectAll');

command - selectParagraph

Selects the paragraph at the given screen coordinates.

NameTypeDescription
actionNamestringAction name
xnumberx coordinate (screen)
ynumbery coordinate (screen)
editor.execCommand('selectParagraph', 100, 100);

command - selectWord

Selects the word at the given screen coordinates.

NameTypeDescription
actionNamestringAction name
xnumberx coordinate (screen)
ynumbery coordinate (screen)
editor.execCommand('selectWord', 100, 100);

command - setCaret

Moves the caret to the given screen coordinates.

NameTypeDescription
actionNamestringAction name
xnumberx coordinate (screen)
ynumbery coordinate (screen)
editor.execCommand('setCaret', 100, 100);

command - setCaretById

Moves the caret to the paragraph identified by id, with the given offset.

NameTypeDescription
actionNamestringAction name
idstringParagraph id
offsetnumberParagraph offset
editor.execCommand('setCaretById', 'paragraph_id', 0);

command - setSelection

Moves the caret to the given coordinates or extends the selection.

NameTypeDescription
actionNamestringAction name
xnumberx coordinate (screen)
ynumbery coordinate (screen)
isExtendbooleanWhether to extend the existing selection (default false)
isFinishbooleanWhether the selection is finished (default false). When finished, scrolling is adjusted.
editor.execCommand('setSelection', 100, 100, false, true);

command - setSelectionByHTMLElement

Selects the given HTML element.

NameTypeDescription
actionNamestringAction name
htmlElementHTMLElementHTML element to select
editor.execCommand('setSelectionByHTMLElement', document.getElementById('test'));

command - up

Moves the caret up.

NameTypeDescription
actionNamestringAction name
editor.execCommand('up');