UNPKG

devexpress-richedit

Version:

DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.

12 lines (11 loc) 674 B
import { SearchUtils } from '@devexpress/utils/lib/utils/search'; import { SelectionCommandBase } from './selection-command-base'; export class SelectParagraphCommand extends SelectionCommandBase { executeCore(_state, options) { var paragraphs = this.selection.activeSubDocument.paragraphs; var paragraphIndex = SearchUtils.normedInterpolationIndexOf(paragraphs, (p) => p.startLogPosition.value, options.param); var paragraph = paragraphs[paragraphIndex]; this.selection.deprecatedSetSelection(paragraph.startLogPosition.value, paragraph.startLogPosition.value + paragraph.length, true, -1, true); return true; } }