* If an [Image #N] chip ends at `offset`, return its bounds. Used by left() * to hop the cursor over the chip instead of stepping into it.
(offset: number)
| 323 | * to hop the cursor over the chip instead of stepping into it. |
| 324 | */ |
| 325 | imageRefEndingAt(offset: number): { start: number; end: number } | null { |
| 326 | const m = this.text.slice(0, offset).match(/\[Image #\d+\]$/) |
| 327 | return m ? { start: offset - m[0].length, end: offset } : null |
| 328 | } |
| 329 | |
| 330 | imageRefStartingAt(offset: number): { start: number; end: number } | null { |
| 331 | const m = this.text.slice(offset).match(/^\[Image #\d+\]/) |