Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getLastNonWhitespaceChar(buffer: Atom.TextBuffer, pos: Atom.Point): string | undefined {
let lastChar: string | undefined
const range = new Atom.Range([0, 0], pos)
buffer.backwardsScanInRange(
/\S/,
range,
({matchText, stop}: {matchText: string; stop: () => void}) => {
lastChar = matchText
stop()
},
)
return lastChar
}
function getLastNonWhitespaceChar(buffer, pos) {
let lastChar;
const range = new Atom.Range([0, 0], pos);
buffer.backwardsScanInRange(/\S/, range, ({ matchText, stop }) => {
lastChar = matchText;
stop();
});
return lastChar;
}
function containsScope(scopes, matchScope) {
_getRange(start, end) {
let buf = this._editor.getBuffer();
return new Range(
buf.positionForCharacterIndex(start),
buf.positionForCharacterIndex(end)
);
}
function itemize (text, row) {
const point = new Point(row, 0)
return {
text: text,
point: point,
range: new Range(point, point)
}
}
function itemize (text, row) {
const point = new Point(row, 0)
return {
text: text,
point: point,
range: new Range(point, point)
}
}