How to use the atom.Point function in atom

To help you get started, we’ve selected a few atom 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 nteract / hydrogen / lib / code-manager.js View on Github external
function adjustCellFoldRange(editor: atom$TextEditor, range: atom$Range) {
  const startRow = range.start.row > 0 ? range.start.row - 1 : 0;
  const startWidth = editor.lineTextForBufferRow(startRow).length;
  const endRow =
    range.end.row == editor.getLastBufferRow()
      ? range.end.row
      : range.end.row - 1;

  return new Range(
    new Point(startRow, startWidth),
    new Point(endRow, range.end.column)
  );
}
github OmniSharp / atom-json-schema / lib / vscode / plugin / jsonFormatter.ts View on Github external
function getEOL(document: Atom.TextEditor): string {
    let text = document.getText();
    if (document.getLineCount() > 1) {
        let to = document.getBuffer().characterIndexForPosition(new Point(1, 0));
        let from = to;
        while (from > 0 && isEOL(text, from - 1)) {
            from--;
        }
        return text.substr(from, to - from);
    }
    return '\n';
}
github OmniSharp / atom-json-schema / vscode / plugin / jsonFormatter.js View on Github external
function getEOL(document) {
    var text = document.getText();
    if (document.getLineCount() > 1) {
        var to = document.getBuffer().characterIndexForPosition(new _atom.Point(1, 0));
        var from = to;
        while (from > 0 && isEOL(text, from - 1)) {
            from--;
        }
        return text.substr(from, to - from);
    }
    return '\n';
}
function isEOL(text, offset) {
github facebookarchive / atom-ide-ui / modules / atom-ide-ui / pkg / atom-ide-find-references / spec / FindReferencesModel-spec.js View on Github external
function range(startLine, startColumn, endLine, endColumn) {
  return new Range(
    new Point(startLine, startColumn),
    new Point(endLine, endColumn),
  );
}
github facebookarchive / atom-ide-ui / modules / atom-ide-ui / pkg / atom-ide-find-references / spec / FindReferencesModel-spec.js View on Github external
function range(startLine, startColumn, endLine, endColumn) {
  return new Range(
    new Point(startLine, startColumn),
    new Point(endLine, endColumn),
  );
}

atom

shared, synchronous, independent state for javascript apps

ISC
Latest version published 8 months ago

Package Health Score

53 / 100
Full package analysis