Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setGoalScreenRange(range) {
this.goalScreenRange = Range.fromObject(range);
}
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)
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);
}