Move the cursor to an explicit column and row position.
966877
def set_cursor(self, col, row):
        """"""
        # Clamp row to the last row of the display.
        if row > self._lines:
            row = self._lines - 1
        # Set location.
        self.write8(LCD_SETDDRAMADDR | (col + LCD_ROW_OFFSETS[row]))
1053101
public synchronized void moveCursor(Cursor cursor)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "moveCursor", new Object[] { cursor });
    
    checkEntryParent();
      
    synchronized(parentList)
    {
      //make sure that the cursor is pointing to an entry in the same list
      if(cursor != null && cursor.parentList == parentList)
      {
        //if we are already pointing to the same entry, we may not have to
        //do anything
        if(cursor.current != current)
        {
          if(cursor.atTop)
          {
            //if the new cursor is at the top, move this one to the top
            moveToTop();
          }
          else if(cursor.atBottom)
          {
            //if the new cursor is at the bottom, move this one to the bottom
            moveToBottom();
          }
          else
          {
            //otherwise just move this cursor to point to the same entry as the
            //one pointed to by the given cursor
            moveCursor(cursor.current);
          }
        }
        else //it is possible that the current entries are both null if they are both
        {    //at the top or bottom on the list
          if(cursor.current == null)
          {
            if(cursor.atTop && atBottom)
            {
              //if the given cursor is at the top but we are at the bottom, move to the top
              moveToTop();
            }
            else if(cursor.atBottom && atTop)
            {
              //if the given cursor is at the bottom but we are at the top, move to the bottom
              moveToBottom();
            }
          }
        }
      }
      else //if the new entry is not in this list, throw a runtime exception
      {
        SIErrorException e = new SIErrorException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0002",
            new Object[] {
              "com.ibm.ws.sib.processor.utils.linkedlist.Cursor",
              "1:541:1.15" },
           null));
  
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor",
          "1:547:1.15",
          this);
  
        SibTr.exception(tc, e);      
  
        if (tc.isEntryEnabled())
          SibTr.exit(tc, "moveCursor", e);
  
        throw e;
      }
    }        
  
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "moveCursor");
  }
1183361
def cursor(lcd, row, col):
    
    warnings.warn('The `cursor` context manager is deprecated', DeprecationWarning)
    lcd.cursor_pos = (row, col)
    yield
243455
def set_cursor_position(self, position):
        """"""
        position = self.get_position(position)
        cursor = self.textCursor()
        cursor.setPosition(position)
        self.setTextCursor(cursor)
        self.ensureCursorVisible()
1138909
def move_column(column=1, file=sys.stdout):
    
    move.column(column).write(file=file)
38241
def insert(self, table, columns, rows):
        
        cursor = self.conn.cursor()
        if len(rows):
            templ, _args = match('INSERT INTO ?s (?S) VALUES (?X)',
                                 table, columns, rows[0])
            cursor.executemany(templ, rows)
        return cursor
1304448
def update_cursor(self, dc, grid, row, col):
        """"""

        old_row, old_col = self.old_cursor_row_col

        bgcolor = get_color(config["background_color"])

        self._draw_cursor(dc, grid, old_row, old_col,
                          pen=wx.Pen(bgcolor), brush=wx.Brush(bgcolor))
        self._draw_cursor(dc, grid, row, col)
390329
def get_column_cursor_position(self, column):
        
        line_length = len(self.current_line)
        current_column = self.cursor_position_col
        column = max(0, min(line_length, column))

        return column - current_column
108070
def set_cursor(self, row, col):
        
        self._vim.current.window.cursor = (row, col)
295113
def _move_cursor_to_column(self, column):
        
        last_col = len(self._cursor.block().text())
        self._cursor.movePosition(self._cursor.EndOfBlock)
        to_insert = ''
        for i in range(column - last_col):
            to_insert += ' '
        if to_insert:
            self._cursor.insertText(to_insert)
        self._cursor.movePosition(self._cursor.StartOfBlock)
        self._cursor.movePosition(self._cursor.Right, self._cursor.MoveAnchor, column)
        self._last_cursor_pos = self._cursor.position()
337565
def moveToReplayContext(self, r):
        ''
        if not r.sheet:
#            assert not r.col and not r.row
            return self  # any old sheet should do, row/column don't matter

        try:
            sheetidx = int(r.sheet)
            vs = vd().sheets[sheetidx]
        except ValueError:
            vs = vd().getSheet(r.sheet) or error('no sheet named %s' % r.sheet)

        if r.row:
            try:
                rowidx = int(r.row)
            except ValueError:
                rowidx = indexMatch(vs.rows, lambda r,vs=vs,k=r.row: keystr(vs.rowkey(r)) == k)

            if rowidx is None:
                error('no "%s" row' % r.row)

            if options.replay_movement:
                while vs.cursorRowIndex != rowidx:
                    vs.cursorRowIndex += 1 if (rowidx - vs.cursorRowIndex) > 0 else -1
                    while not self.delay(0.5):
                        pass
            else:
                vs.cursorRowIndex = rowidx

        if r.col:
            try:
                vcolidx = int(r.col)
            except ValueError:
                vcolidx = indexMatch(vs.visibleCols, lambda c,name=r.col: name == c.name)

            if vcolidx is None:
                error('no "%s" column' % r.col)

            if options.replay_movement:
                while vs.cursorVisibleColIndex != vcolidx:
                    vs.cursorVisibleColIndex += 1 if (vcolidx - vs.cursorVisibleColIndex) > 0 else -1
                    while not self.delay(0.5):
                        pass

                assert vs.cursorVisibleColIndex == vcolidx
            else:
                vs.cursorVisibleColIndex = vcolidx
        return vs
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();
		}
	}
677505
function ()
	{
		var aoColumns = this.s.dt.aoColumns;

		this.s.aoTargets.splice( 0, this.s.aoTargets.length );

		this.s.aoTargets.push( {
			"x":  $(this.s.dt.nTable).offset().left,
			"to": 0
		} );

		var iToPoint = 0;
		for ( var i=0, iLen=aoColumns.length ; i<iLen ; i++ )
		{
			/* For the column / header in question, we want it's position to remain the same if the
			 * position is just to it's immediate left or right, so we only incremement the counter for
			 * other columns
			 */
			if ( i != this.s.mouse.fromIndex )
			{
				iToPoint++;
			}

			if ( aoColumns[i].bVisible )
			{
				this.s.aoTargets.push( {
					"x":  $(aoColumns[i].nTh).offset().left + $(aoColumns[i].nTh).outerWidth(),
					"to": iToPoint
				} );
			}
		}

		/* Disallow columns for being reordered by drag and drop, counting right to left */
		if ( this.s.fixedRight !== 0 )
		{
			this.s.aoTargets.splice( this.s.aoTargets.length - this.s.fixedRight );
		}

		/* Disallow columns for being reordered by drag and drop, counting left to right */
		if ( this.s.fixed !== 0 )
		{
			this.s.aoTargets.splice( 0, this.s.fixed );
		}
	}
1175068
def _adjust_rowcol(self, insertion_point, no_to_insert, axis, tab=None):
        """"""

        if axis == 2:
            self._shift_rowcol(insertion_point, no_to_insert)
            return

        assert axis in (0, 1)

        cell_sizes = self.col_widths if axis else self.row_heights
        set_cell_size = self.set_col_width if axis else self.set_row_height

        new_sizes = {}
        del_sizes = []

        for pos, table in cell_sizes:
            if pos > insertion_point and (tab is None or tab == table):
                if 0 <= pos + no_to_insert < self.shape[axis]:
                    new_sizes[(pos + no_to_insert, table)] = \
                        cell_sizes[(pos, table)]
                del_sizes.append((pos, table))

        for pos, table in new_sizes:
            set_cell_size(pos, table, new_sizes[(pos, table)])

        for pos, table in del_sizes:
            if (pos, table) not in new_sizes:
                set_cell_size(pos, table, None)
232216
def write(self, value):  # type: (int) -> None
        """"""

        # Get current position
        row, col = self._cursor_pos

        # Write byte if changed
        try:
            if self._content[row][col] != value:
                self._send_data(value)
                self._content[row][col] = value  # Update content cache
                unchanged = False
            else:
                unchanged = True
        except IndexError as e:
            # Position out of range
            if self.auto_linebreaks is True:
                raise e
            self._send_data(value)
            unchanged = False

        # Update cursor position.
        if self.text_align_mode == 'left':
            if self.auto_linebreaks is False or col < self.lcd.cols - 1:
                # No newline, update internal pointer
                newpos = (row, col + 1)
                if unchanged:
                    self.cursor_pos = newpos
                else:
                    self._cursor_pos = newpos
                self.recent_auto_linebreak = False
            else:
                # Newline, reset pointer
                if row < self.lcd.rows - 1:
                    self.cursor_pos = (row + 1, 0)
                else:
                    self.cursor_pos = (0, 0)
                self.recent_auto_linebreak = True
        else:
            if self.auto_linebreaks is False or col > 0:
                # No newline, update internal pointer
                newpos = (row, col - 1)
                if unchanged:
                    self.cursor_pos = newpos
                else:
                    self._cursor_pos = newpos
                self.recent_auto_linebreak = False
            else:
                # Newline, reset pointer
                if row < self.lcd.rows - 1:
                    self.cursor_pos = (row + 1, self.lcd.cols - 1)
                else:
                    self.cursor_pos = (0, self.lcd.cols - 1)
                self.recent_auto_linebreak = True
1260558
def _drag_col(self, event):
        """"""
        x = self._dx + event.x  # get dragged column new left x coordinate
        self._visual_drag.place_configure(x=x)  # update column preview position
        # if one border of the dragged column is beyon the middle of the
        # neighboring column, swap them
        if (self._dragged_col_neighbor_widths[0] is not None and
               x < self._dragged_col_x - self._dragged_col_neighbor_widths[0] / 2):
            self._swap_columns('left')
        elif (self._dragged_col_neighbor_widths[1] is not None and
               x > self._dragged_col_x + self._dragged_col_neighbor_widths[1] / 2):
            self._swap_columns('right')
        # horizontal scrolling if the cursor reaches the side of the table
        if x < 0 and self.xview()[0] > 0:
            # scroll left and update dragged column x coordinate
            self.xview_scroll(-10, 'units')
            self._dragged_col_x += 10
        elif x + self._dragged_col_width / 2 > self.winfo_width() and self.xview()[1] < 1:
            # scroll right and update dragged column x coordinate
            self.xview_scroll(10, 'units')
            self._dragged_col_x -= 10
1343816
def placeCursor(self, pos):
        
        if pos > len(self.qteWidget.toPlainText()):
            pos = len(self.qteWidget.toPlainText())

        tc = self.qteWidget.textCursor()
        tc.setPosition(pos)
        self.qteWidget.setTextCursor(tc)