( state: EditorView["state"], line: LineInfo, )
| 28 | * full-line selection behavior. |
| 29 | */ |
| 30 | export function getLineSelectionRange( |
| 31 | state: EditorView["state"], |
| 32 | line: LineInfo, |
| 33 | ): { from: number; to: number } | null { |
| 34 | if (!line) return null; |
| 35 | const from = Math.max(0, toDocumentOffset(line.from)); |
| 36 | const to = Math.max(from, toDocumentOffset(line.to, from)); |
| 37 | return { |
| 38 | from, |
| 39 | to: Math.min(to + 1, state.doc.length), |
| 40 | }; |
| 41 | } |
| 42 | |
| 43 | function getCurrentSelectionLineRange(state: EditorView["state"]): { |
| 44 | from: number; |
no test coverage detected