How to use the text-buffer.Range.fromObject function in text-buffer

To help you get started, we’ve selected a few text-buffer 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 / atom / src / selection.js View on Github external
setGoalScreenRange(range) {
    this.goalScreenRange = Range.fromObject(range);
  }
github atom / atom / src / selection.js View on Github external
setBufferRange(bufferRange, options = {}) {
    bufferRange = Range.fromObject(bufferRange);
    if (options.reversed == null) options.reversed = this.isReversed();
    if (!options.preserveFolds)
      this.editor.destroyFoldsContainingBufferPositions(
        [bufferRange.start, bufferRange.end],
        true
      );
    this.modifySelection(() => {
      const needsFlash = options.flash;
      options.flash = null;
      this.marker.setBufferRange(bufferRange, options);
      const autoscroll =
        options.autoscroll != null
          ? options.autoscroll
          : this.isLastSelection();
      if (autoscroll) this.autoscroll();
      if (needsFlash)
github atom / atom / src / cursor.js View on Github external
getCurrentWordBufferRange(options = {}) {
    const position = this.getBufferPosition();
    const ranges = this.editor.buffer.findAllInRangeSync(
      options.wordRegex || this.wordRegExp(options),
      new Range(new Point(position.row, 0), new Point(position.row, Infinity))
    );
    const range = ranges.find(
      range =>
        range.end.column >= position.column &&
        range.start.column <= position.column
    );
    return range ? Range.fromObject(range) : new Range(position, position);
  }

text-buffer

A container for large mutable strings with annotated regions

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages