* 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)
| 298 | * to hop the cursor over the chip instead of stepping into it. |
| 299 | */ |
| 300 | imageRefEndingAt(offset: number): { start: number; end: number } | null { |
| 301 | const m = this.text.slice(0, offset).match(/\[Image #\d+\]$/) |
| 302 | return m ? { start: offset - m[0].length, end: offset } : null |
| 303 | } |
| 304 | |
| 305 | imageRefStartingAt(offset: number): { start: number; end: number } | null { |
| 306 | const m = this.text.slice(offset).match(/^\[Image #\d+\]/) |