Return the line number (0 based) of the input document that corresponds
        with the first visible line.
496862
def first_visible_line(self, after_scroll_offset=False):
        
        if after_scroll_offset:
            return self.displayed_lines[self.applied_scroll_offsets.top]
        else:
            return self.displayed_lines[0]
709930
def blockstart_tolineno(self):
        
        if self.name:
            return self.name.tolineno
        if self.type:
            return self.type.tolineno
        return self.lineno
896889
def _get_starting_indent(source):
  """"""
  if source.startswith(" "):
    return sum(1 for _ in itertools.takewhile(lambda c: c in {' ', b' '}, source))
  return 0
571314
private String getNextLine() {
    try {
      if (!this.linesSkiped) {
        for (int i = 0; i < skipLines; i++) {
          br.readLine();
        }
        this.linesSkiped = true;
      }
      String nextLine = br.readLine();
      if (nextLine == null) {
        hasNext = false;
      }
      return hasNext ? nextLine : null;
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

  }
119440
function lineCount(value) {
        var rows = 0;
        if (value) {
            rows = 1;
            value.toString().each(/\n/, function () { return rows++; });
        }
        return rows;
    }
516741
def go_to_line(self, line):
        

        cursor = self.textCursor()
        cursor.setPosition(self.document().findBlockByNumber(line - 1).position())
        self.setTextCursor(cursor)
        return True
345945
def get_line_numbers(self, buffer):
        
        # Get absolute cursor positions from the text object.
        from_, to = self.operator_range(buffer.document)
        from_ += buffer.cursor_position
        to += buffer.cursor_position

        # Take the start of the lines.
        from_, _ = buffer.document.translate_index_to_position(from_)
        to, _ = buffer.document.translate_index_to_position(to)

        return from_, to
1120494
def get_range_start_line_number(self,rng):
    
    sys.stderr.write("error unimplemented get_range_start_line\n")
    sys.exit()
    for i in range(0,len(self._lines)):
      if rng.cmp(self._lines[i]['rng'])==0: return i+1
    return None
1164482
def find_first(data, what):
    '''
    
    '''
    for i, line in enumerate(data):
        if contains(line, what):
            return i
            
    return None
186615
def get_line_number(doc, wrange):
    """"""
    lineno = 1
    wrange.Select()
    wdFirstCharacterLineNumber = constants("wdFirstCharacterLineNumber")
    wdGoToLine = constants("wdGoToLine")
    wdGoToPrevious = constants("wdGoToPrevious")
    while True:
        curline = doc.Selection.Information(wdFirstCharacterLineNumber)
        doc.Selection.GoTo(wdGoToLine, wdGoToPrevious, Count=1, Name="")
        lineno += 1
        prevline = doc.Selection.Information(wdFirstCharacterLineNumber)
        if prevline == curline:
            break
    return lineno
1215495
public int getLineNumber(Location start) {
        LineNumberTableAttr table = mOldLineNumberTable;
        if (table == null) {
            table = mLineNumberTable;
        }

        if (table == null || start.getLocation() < 0) {
            return -1;
        } else {
            return table.getLineNumber(start);
        }
    }
1271019
def find_newline(self, size=-1):
    
    if size < 0:
      return self._buffer.find('\n', self._offset)
    return self._buffer.find('\n', self._offset, self._offset + size)
657683
def get_span(self, first_line_no: int) -> Tuple[int, int]:
        
        if not self.nodes:
            raise EmptyBlock('span requested from {} block with no nodes'.format(self.line_type))
        return (
            get_first_token(self.nodes[0]).start[0] - first_line_no,
            get_last_token(self.nodes[-1]).start[0] - first_line_no,
        )
1189205
def get_coord_line_number(self,coord):
    """"""
    if coord[0] in self._coords:
      if coord[1] in self._coords[coord[0]]:
        return self._coords[coord[0]][coord[1]]
    return None
109608
def _get_line(self):
        """"""
        line = self._f.readline()
        if len(line) == 0:
            raise StopIteration
        return line
1101624
def visible_line_width(self, position = Point):
        """"""
        extra_char_width = len([ None for c in self[:position].line_buffer if 0x2013 <= ord(c) <= 0xFFFD])
        return len(self[:position].quoted_text()) + self[:position].line_buffer.count(u"\t")*7 + extra_char_width
86535
protected String getTextLineNumber(int rowStartOffset) {
    Element root = component.getDocument().getDefaultRootElement();
    int index = root.getElementIndex(rowStartOffset);
    Element line = root.getElement(index);

    if (line.getStartOffset() == rowStartOffset)
      return String.valueOf(index + 1);
    else
      return "";
  }