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

        // read everything up until before current position
        $pre  = $this->substr($this->linebuffer, 0, $n);
        $post = $this->substr($this->linebuffer, $n + 1);

        $this->linebuffer = $pre . $post;

        // move cursor one cell to the left if we're deleting in front of the cursor
        if ($n < $this->linepos) {
            --$this->linepos;
        }

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

        // read everything up until before current position
        $pre  = $this->substr($this->linebuffer, 0, $n);
        $post = $this->substr($this->linebuffer, $n + 1);

        $this->linebuffer = $pre . $post;

        // move cursor one cell to the left if we're deleting in front of the cursor
        if ($n < $this->linepos) {
            --$this->linepos;
        }

        $this->redraw();
    }
public function deleteChar ( $ n ) { $ len = $ this -> strlen ( $ this -> linebuffer ) ; if ( $ n < 0 || $ n >= $ len ) { return ; } // read everything up until before current position $ pre = $ this -> substr ( $ this -> linebuffer , 0 , $ n ) ; $ post = $ this -> substr ( $ this -> linebuffer , $ n + 1 ) ; $ this -> linebuffer = $ pre . $ post ; // move cursor one cell to the left if we're deleting in front of the cursor if ( $ n < $ this -> linepos ) { -- $ this -> linepos ; } $ this -> redraw ( ) ; }
delete a character at the given position

Removing a character left to the current cursor will also move the cursor
to the left.

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

@param int $n
@internal
delete a character at the given position