How to use the superstring.MarkerIndex function in superstring

To help you get started, we’ve selected a few superstring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github atom / text-buffer / spec / helpers / test-language-mode.js View on Github external
constructor (decorations, buffer, random) {
    this.buffer = buffer
    this.random = random
    this.nextMarkerId = MAX_BUILT_IN_SCOPE_ID + 1
    this.markerIndex = new MarkerIndex()
    this.classNamesByScopeId = new Map()
    this.emitter = new Emitter()
    this.invalidatedRanges = []

    if (this.buffer) {
      this.buffer.onDidChange(() => {
        for (const invalidatedRange of this.invalidatedRanges) {
          this.emitHighlightingChangeEvent(invalidatedRange)
        }
        this.invalidatedRanges = []
      })
    }

    for (let value of decorations) {
      const className = value[0]
      const [rangeStart, rangeEnd] = Array.from(value[1])

superstring

A data structure to efficiently represent the results of applying patches.

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis