Toggle line numbers.
760151
def toggle_line_numbers(self, checked):
        """"""
        if self.tabwidget is None:
            return
        for editor in self.editors:
            editor.toggle_line_numbers(linenumbers=checked, markers=False)
        self.set_option('line_numbers', checked)
1160273
def toggleActions(self, value=True):
        """"""
        for z in self.actions.zoomActions:
            z.setEnabled(value)
        for action in self.actions.onLoadActive:
            action.setEnabled(value)
29029
function permuteLine(line, startIndex){
    var newLine = [];
    for (let i = 0; i < line.length; i++){
        var index = (i + startIndex) % line.length;
        // skip the first (repeated) index
        if (index !== 0) {
            newLine.push(line[index]);
        }
    }
    newLine.push(newLine[0]);
    return newLine;
}
897326
def _on_change(self):
        """"""
        if callable(self.__callback):
            self.__callback((self._family, self._size, self._bold, self._italic, self._underline, self._overstrike))
420143
def OnMarginClick(self, evt):
        """"""

        if evt.GetMargin() == 2:
            if evt.GetShift() and evt.GetControl():
                self.fold_all()
            else:
                line_clicked = self.LineFromPosition(evt.GetPosition())

                if self.GetFoldLevel(line_clicked) & \
                   stc.STC_FOLDLEVELHEADERFLAG:
                    if evt.GetShift():
                        self.SetFoldExpanded(line_clicked, True)
                        self.expand(line_clicked, True, True, 1)
                    elif evt.GetControl():
                        if self.GetFoldExpanded(line_clicked):
                            self.SetFoldExpanded(line_clicked, False)
                            self.expand(line_clicked, False, True, 0)
                        else:
                            self.SetFoldExpanded(line_clicked, True)
                            self.expand(line_clicked, True, True, 100)
                    else:
                        self.ToggleFold(line_clicked)
61880
def SetLines(self, lines):
    

    (self._cli_lines, self._cli_cols) = TerminalSize()

    if lines:
      self._cli_lines = int(lines)
910479
function setGuttersForLineNumbers(options) {
    var found = false;
    for (var i = 0; i < options.gutters.length; ++i) {
      if (options.gutters[i] == "CodeMirror-linenumbers") {
        if (options.lineNumbers) found = true;
        else options.gutters.splice(i--, 1);
      }
    }
    if (!found && options.lineNumbers)
      options.gutters.push("CodeMirror-linenumbers");
  }
652998
def toggle_buttons(self):
        """"""
        all_types = self.all_types.get_value()
        self.idx_evt_type.setEnabled(not all_types)
486955
def mousePressEvent(self, event):
        
        line_number = self.editor.get_linenumber_from_mouse_event(event)
        self._pressed = line_number
        self._released = line_number
        self.editor.select_lines(self._pressed,
                                 self._released)
804962
def _draw_line_numbers(self):
        
        if not self.line_numbers:
            return
        for p in xrange(self.maxlineno):
            n = p + self.line_number_start
            if (n % self.line_number_step) == 0:
                self._draw_linenumber(p, n)
433982
def _enum_lines(self):
        """"""
        with _open_table(self.path, self.encoding) as lines:
            for i, line in enumerate(lines):
                yield i, line
805736
def update_cursor_position(self, line, index):
        """"""
        value = 'Line {}, Col {}'.format(line + 1, index + 1)
        self.set_value(value)
851453
public void moveCursorLine (int line) {
		if (line < 0) {
			cursorLine = 0;
			cursor = 0;
			moveOffset = -1;
		} else if (line >= getLines()) {
			int newLine = getLines() - 1;
			cursor = text.length();
			if (line > getLines() || newLine == cursorLine) {
				moveOffset = -1;
			}
			cursorLine = newLine;
		} else if (line != cursorLine) {
			if (moveOffset < 0) {
				moveOffset = linesBreak.size <= cursorLine * 2 ? 0
						: glyphPositions.get(cursor) - glyphPositions.get(linesBreak.get(cursorLine * 2));
			}
			cursorLine = line;
			cursor = cursorLine * 2 >= linesBreak.size ? text.length() : linesBreak.get(cursorLine * 2);
			while (cursor < text.length() && cursor <= linesBreak.get(cursorLine * 2 + 1) - 1
					&& glyphPositions.get(cursor) - glyphPositions.get(linesBreak.get(cursorLine * 2)) < moveOffset) {
				cursor++;
			}
			showCursor();
		}
	}
791380
def _updateNumbers(self, linenumers):
        
        b = self.blockCount()
        c = b - linenumers
        if c > 0:
            # remove lines numbers
            for _ in range(c):
                # remove last line:
                self.setFocus()
                storeCursorPos = self.textCursor()
                self.moveCursor(
                    QtGui.QTextCursor.End,
                    QtGui.QTextCursor.MoveAnchor)
                self.moveCursor(
                    QtGui.QTextCursor.StartOfLine,
                    QtGui.QTextCursor.MoveAnchor)
                self.moveCursor(
                    QtGui.QTextCursor.End,
                    QtGui.QTextCursor.KeepAnchor)
                self.textCursor().removeSelectedText()
                self.textCursor().deletePreviousChar()
                self.setTextCursor(storeCursorPos)
        elif c < 0:
            # add line numbers
            for i in range(-c):
                self.appendPlainText(str(b + i + 1))
1026361
def highlight_current_line(self):
        """"""
        selection = TextDecoration(self.textCursor())
        selection.format.setProperty(QTextFormat.FullWidthSelection,
                                     to_qvariant(True))
        selection.format.setBackground(self.currentline_color)
        selection.cursor.clearSelection()
        self.set_extra_selections('current_line', [selection])
        self.update_extra_selections()
929627
def unindent(self, lines):
        """"""
        indent = min(
            len(self.re.match(r'^ *', line).group()) for line in lines)
        return [line[indent:].rstrip() for line in lines]
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