Set cursor to bookmarked file and position.
507209
def load_bookmark(self, slot_num):
        """"""
        bookmarks = CONF.get('editor', 'bookmarks')
        if slot_num in bookmarks:
            filename, line_num, column = bookmarks[slot_num]
        else:
            return
        if not osp.isfile(filename):
            self.last_edit_cursor_pos = None
            return
        self.load(filename)
        editor = self.get_current_editor()
        if line_num < editor.document().lineCount():
            linelength = len(editor.document()
                             .findBlockByNumber(line_num).text())
            if column <= linelength:
                editor.go_to_line(line_num + 1, column)
            else:
                # Last column
                editor.go_to_line(line_num + 1, linelength)
866166
def set_position(self, position):
        """"""
        if position < 0:
            position += len(self.checkdefs)
        while position >= len(self.checkdefs):
            self.checkdefs.append(([], []))
        self.position = position
253504
def cursor(self, status):
        """"""
        self._display_control = ByteUtil.apply_flag(self._display_control, Command.CURSOR_ON, status)
        self.command(self._display_control)
388224
def cursor_position(self, value):
        
        assert isinstance(value, int)
        assert value <= len(self.text)

        changed = self._set_cursor_position(value)

        if changed:
            self._cursor_position_changed()
550293
def _seek(self, index, maxpages=None):
        """"""
        pages = self.pages
        lenpages = len(pages)
        if lenpages == 0:
            raise IndexError('index out of range')

        fh = self.parent.filehandle
        if fh.closed:
            raise ValueError('seek of closed file')

        if self._indexed or 0 <= index < lenpages:
            page = pages[index]
            offset = page if isinstance(page, inttypes) else page.offset
            fh.seek(offset)
            return

        tiff = self.parent.tiff
        offsetformat = tiff.ifdoffsetformat
        offsetsize = tiff.ifdoffsetsize
        tagnoformat = tiff.tagnoformat
        tagnosize = tiff.tagnosize
        tagsize = tiff.tagsize
        unpack = struct.unpack

        page = pages[-1]
        offset = page if isinstance(page, inttypes) else page.offset

        if maxpages is None:
            maxpages = 2**22
        while lenpages < maxpages:
            # read offsets to pages from file until index is reached
            fh.seek(offset)
            # skip tags
            try:
                tagno = unpack(tagnoformat, fh.read(tagnosize))[0]
                if tagno > 4096:
                    raise TiffFileError(
                        'suspicious number of tags: %i' % tagno)
            except Exception:
                log.warning('TiffPages: corrupted tag list of page %i @ %i',
                            lenpages, offset)
                del pages[-1]
                lenpages -= 1
                self._indexed = True
                break
            self._nextpageoffset = offset + tagnosize + tagno * tagsize
            fh.seek(self._nextpageoffset)

            # read offset to next page
            offset = unpack(offsetformat, fh.read(offsetsize))[0]
            if offset == 0:
                self._indexed = True
                break
            if offset >= fh.size:
                log.warning('TiffPages: invalid page offset (%i)', offset)
                self._indexed = True
                break

            pages.append(offset)
            lenpages += 1
            if 0 <= index < lenpages:
                break

            # detect some circular references
            if lenpages == 100:
                for p in pages[:-1]:
                    if offset == (p if isinstance(p, inttypes) else p.offset):
                        raise TiffFileError('invalid circular IFD reference')

        if index >= lenpages:
            raise IndexError('index out of range')

        page = pages[index]
        fh.seek(page if isinstance(page, inttypes) else page.offset)
655322
function (length, cycles, position, iteration, ref) {
        return new Cursor(length, cycles, position, iteration, ref);
    }
400489
def copy_current_file_offset():
    """"""
    start, end = sark.get_selection()

    try:
        file_offset = sark.core.get_fileregion_offset(start)
        clipboard.copy("0x{:08X}".format(file_offset))

    except sark.exceptions.NoFileOffset:
        message("The current address cannot be mapped to a valid offset of the input file.")
206620
def setText(self, sequence):
        """"""
        self.setToolTip(sequence)
        super(ShortcutLineEdit, self).setText(sequence)
480604
def reload(self):
        
        text = self._read(self.location)
        cursor_position = min(self.buffer.cursor_position, len(text))

        self.buffer.document = Document(text, cursor_position)
        self._file_content = text
1189486
function recurse_bookmarks(data, tree, path) {
  if(tree.url) data.push({Name: tree.title, Location: tree.url, Path:path});
  var T = path ? (path + "::" + tree.title) : tree.title;
  (tree.children||[]).forEach(function(C) { recurse_bookmarks(data, C, T); });
}
1344037
def _cursor_position(self, data):
        
        column, line = self._get_line_and_col(data)
        self._move_cursor_to_line(line)
        self._move_cursor_to_column(column)
        self._last_cursor_pos = self._cursor.position()
258285
def go_to_position(self, position):
        

        cursor = self.textCursor()
        cursor.setPosition(position)
        self.setTextCursor(cursor)
        return True
476897
def save_bookmarks(self, filename, bookmarks):
        """"""
        filename = to_text_string(filename)
        bookmarks = to_text_string(bookmarks)
        filename = osp.normpath(osp.abspath(filename))
        bookmarks = eval(bookmarks)
        save_bookmarks(filename, bookmarks)
866666
def locate(command, on):
    """"""
    location = find_page_location(command, on)
    click.echo(location)
386085
def on_hazard_exposure_bookmark_toggled(self, enabled):
        
        if enabled:
            self.bookmarks_index_changed()
        else:
            self.ok_button.setEnabled(True)
        self._populate_coordinates()
805736
def update_cursor_position(self, line, index):
        """"""
        value = 'Line {}, Col {}'.format(line + 1, index + 1)
        self.set_value(value)
1007043
def get_cursor_position(self, file_path):
        
        try:
            map = json.loads(self._settings.value('cachedCursorPosition'))
        except TypeError:
            map = {}
        try:
            pos = map[file_path]
        except KeyError:
            pos = 0
        if isinstance(pos, list):
            # changed in pyqode 2.6.3, now we store the cursor position
            # instead of the line and column  (faster)
            pos = 0
        return pos