Method
constructor
(
readonly measuredText: MeasuredText,
offset: number = 0,
readonly selection: number = 0,
)
Source from the content-addressed store, hash-verified
| 151 | export class Cursor { |
| 152 | readonly offset: number |
| 153 | constructor( |
| 154 | readonly measuredText: MeasuredText, |
| 155 | offset: number = 0, |
| 156 | readonly selection: number = 0, |
| 157 | ) { |
| 158 | // it's ok for the cursor to be 1 char beyond the end of the string |
| 159 | this.offset = Math.max(0, Math.min(this.text.length, offset)) |
| 160 | } |
| 161 | |
| 162 | static fromText( |
| 163 | text: string, |
Callers
nothing calls this directly
Tested by
no test coverage detected