Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 60x 60x 60x | import {Anchor} from '../rga/constants'; import {PersistedSlice} from './PersistedSlice'; import type {Range} from '../rga/Range'; /** * Represents a block split in the text, i.e. it is a *marker* that shows * where a block was split. Markers also insert one "\n" new line character. * Both marker ends are attached to the "before" anchor fo the "\n" new line * character, i.e. it is *collapsed* to the "before" anchor. */ export class MarkerSlice<T = string> extends PersistedSlice<T> { /** * Returns the {@link Range} which exactly contains the block boundary of this * marker. */ public boundary(): Range<T> { const start = this.start; const end = start.clone(); end.anchor = Anchor.After; return this.txt.range(start, end); } } |