(
state: EditorView["state"],
clickedRange: { from: number; to: number },
)
| 67 | } |
| 68 | |
| 69 | function createExtendedLineSelection( |
| 70 | state: EditorView["state"], |
| 71 | clickedRange: { from: number; to: number }, |
| 72 | ): EditorSelection { |
| 73 | const currentRange = getCurrentSelectionLineRange(state); |
| 74 | const from = Math.min(currentRange.from, clickedRange.from); |
| 75 | const to = Math.max(currentRange.to, clickedRange.to); |
| 76 | |
| 77 | if (clickedRange.from <= currentRange.from) { |
| 78 | return EditorSelection.single(to, from); |
| 79 | } |
| 80 | |
| 81 | return EditorSelection.single(from, to); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Select the clicked line from the line-number gutter. |
no test coverage detected