public function moveCursorTo($n)
    {
        if ($n < 0 || $n === $this->linepos || $n > $this->strlen($this->linebuffer)) {
            return $this;
        }

        $old = $this->getCursorCell();
        $this->linepos = $n;

        // only redraw if visible cell position change (implies cursor is actually visible)
        if ($this->getCursorCell() !== $old) {
            $this->redraw();
        }

        return $this;
    }
public function moveCursorTo($n)
    {
        if ($n < 0 || $n === $this->linepos || $n > $this->strlen($this->linebuffer)) {
            return $this;
        }

        $old = $this->getCursorCell();
        $this->linepos = $n;

        // only redraw if visible cell position change (implies cursor is actually visible)
        if ($this->getCursorCell() !== $old) {
            $this->redraw();
        }

        return $this;
    }
public function moveCursorTo ( $ n ) { if ( $ n < 0 || $ n === $ this -> linepos || $ n > $ this -> strlen ( $ this -> linebuffer ) ) { return $ this ; } $ old = $ this -> getCursorCell ( ) ; $ this -> linepos = $ n ; // only redraw if visible cell position change (implies cursor is actually visible) if ( $ this -> getCursorCell ( ) !== $ old ) { $ this -> redraw ( ) ; } return $ this ; }
Moves cursor to given position in current line buffer.

Values out of range (exceeding current input buffer) are simply ignored.

Will redraw() the readline only if the visible cell position changes,
see `self::getCursorCell()` for more details.

@param int $n
@return self
@uses self::redraw()
Moves cursor to given position in current line buffer .