Moves the cursor to the end of the previous editor
15752
def goBack(self):
        
        index = self.indexOf(self.currentEditor())
        if index == -1:
            return
        
        previous = self.editorAt(index - 1)
        if previous:
            previous.setFocus()
            previous.setCursorPosition(self.sectionLength())
504782
def close_editors(self, ):
        
        for k in reversed(self._edit_widgets.keys()):
            self.commit_close_editor(k)
1140488
def swap_characters_before_cursor(self):
        
        pos = self.cursor_position

        if pos >= 2:
            a = self.text[pos - 2]
            b = self.text[pos - 1]

            self.text = self.text[:pos-2] + b + a + self.text[pos:]
199674
def drag(start_x, start_y, end_x, end_y, absolute=True, duration=0):
    
    if is_pressed():
        release()
    move(start_x, start_y, absolute, 0)
    press()
    move(end_x, end_y, absolute, duration)
    release()
290830
def save_cursor(self):
        """"""
        self.savepoints.append(Savepoint(copy.copy(self.cursor),
                                         self.g0_charset,
                                         self.g1_charset,
                                         self.charset,
                                         mo.DECOM in self.mode,
                                         mo.DECAWM in self.mode))
785608
def move_to_start(self, column_label):
        """"""
        self._columns.move_to_end(column_label, last=False)
        return self
1355399
def _collapse_cursor(self, parts):
        

        final_parts = []
        for part in parts:

            # Throw out empty string tokens ("")
            if not part:
                continue

            # Go back, deleting every token in the last 'line'
            if part == CursorMoveUp:
                if final_parts:
                    final_parts.pop()

                while final_parts and '\n' not in final_parts[-1]:
                    final_parts.pop()

                continue

            # Otherwise, just pass this token forward
            final_parts.append(part)

        return final_parts
375153
function getRangeAfterCursor( cursor, inclusive ) {
				var range = editor.createRange();
				range.setStart( cursor.textNode, ( inclusive ? cursor.offset : cursor.offset + 1 ) );
				range.setEndAt( editor.editable(), CKEDITOR.POSITION_BEFORE_END );
				return range;
			}
87783
function collapseCurrent() {
        var editor = EditorManager.getFocusedEditor();
        if (!editor) {
            return;
        }
        var cm = editor._codeMirror;
        var cursor = editor.getCursorPos(), i;
        // Move cursor up until a collapsible line is found
        for (i = cursor.line; i >= 0; i--) {
            if (cm.foldCode(i)) {
                editor.setCursorPos(i);
                return;
            }
        }
    }
1220515
def _cursor_down(self, value):
        
        self._cursor.clearSelection()
        if self._cursor.atEnd():
            self._cursor.insertText('\n')
        else:
            self._cursor.movePosition(self._cursor.Down, self._cursor.MoveAnchor, value)
        self._last_cursor_pos = self._cursor.position()
475347
function deleteCurrentLines(editor) {
        editor = editor || EditorManager.getFocusedEditor();
        if (!editor) {
            return;
        }

        // Walk the selections, calculating the deletion edits we need to do as we go;
        // document.doMultipleEdits() will take care of adjusting the edit locations when
        // it actually performs the edits.
        var doc = editor.document,
            from,
            to,
            lineSelections = editor.convertToLineSelections(editor.getSelections()),
            edits = [];

        _.each(lineSelections, function (lineSel, index) {
            var sel = lineSel.selectionForEdit;

            from = sel.start;
            to = sel.end; // this is already at the beginning of the line after the last selected line
            if (to.line === editor.getLastVisibleLine() + 1) {
                // Instead of deleting the newline after the last line, delete the newline
                // before the beginning of the line--unless this is the entire visible content
                // of the editor, in which case just delete the line content.
                if (from.line > editor.getFirstVisibleLine()) {
                    from.line -= 1;
                    from.ch = doc.getLine(from.line).length;
                }
                to.line -= 1;
                to.ch = doc.getLine(to.line).length;
            }

            // We don't need to track the original selections, since they'll get collapsed as
            // part of the various deletions that occur.
            edits.push({edit: {text: "", start: from, end: to}});
        });
        doc.doMultipleEdits(edits);
    }
623262
def move_cursor_to_next(self, what='word', direction='left'):
        
        self.__move_cursor_anchor(what, direction, QTextCursor.MoveAnchor)
618193
function getRangeBeforeCursor( cursor ) {
				var range = editor.createRange();
				range.setStartAt( editor.editable(), CKEDITOR.POSITION_AFTER_START );
				range.setEnd( cursor.textNode, cursor.offset );
				return range;
			}
1237486
function insertFormattedLineBreak(cursor) {
	const indent = cursor.editor.getTabText();
	const lineIndent = getLineIndent(cursor);

	cursor.selection.insertText(`\n${lineIndent}${indent}\n${lineIndent}`, { autoIndent: false });

	// Put caret at the end of indented newline
	cursor.moveUp();
	cursor.moveToEndOfLine();
}
351751
private void moveSiblingExclusive(Node dest, Node start, Node end) {
    checkNotNull(start);
    checkNotNull(end);
    while (start.getNext() != end) {
      Node child = start.getNext().detach();
      dest.addChildToBack(child);
    }
  }
1015880
def close_editor_buffer(self, editor_buffer):
        
        for split, window in self._walk_through_windows():
            if window.editor_buffer == editor_buffer:
                self._close_window(window)
901576
function Cursor(tree, start, end) {
        this.tree = tree;
        this.start = start;
        this.end = end;
        
        var self = this;
        this.walk = function walk(node, iterator) {
            if (node === null) return;
            
            if (start !== undefined && node.key < start) {
                walk(node.right, iterator);
            } else if (end !== undefined && node.key > end) {
                walk(node.left, iterator);
            } else {
                walk(node.left, iterator);
                iterator(node.value, node.key, self.tree);
                walk(node.right, iterator);
            }
        };
    }