Editor.processLines method
Editor › processLines
Official
Process lines.Signature:
processLines(read: (line: number, lineText: string) => T | null, write: (line: number, lineText: string, value: T | null) => void | EditorChange, ignoreEmpty?: boolean | undefined): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| read | (line: number, lineText: string) => T | null | Computes a value for a line. |
| write | (line: number, lineText: string, value: T | null) => void | EditorChange | Computes the change for a line, given its value. Return nothing to leave the line unchanged. |
| ignoreEmpty? | boolean | undefined | Whether to skip empty lines when multiple lines are selected. |
Returns: void
Since: 0.13.26
Example:
editor.processLines( (line, lineText) => lineText.startsWith('- '), (line, lineText, isListItem) => isListItem ? undefined : { from: { line, ch: 0 }, text: '- ' },);