Пример #1
0
 public function _bindK()
 {
     if ($this->columnOffset == $this->table->getNumberOfColumns() - 1) {
         Cursor::bip();
     } else {
         $this->columnOffset++;
         $this->renderInternal();
     }
     return Readline::STATE_NO_ECHO;
 }
Пример #2
0
 /**
  * Readline core.
  *
  * @param   string  $char    Char.
  * @return  string
  */
 public function _readLine($char)
 {
     if (isset($this->_mapping[$char]) && is_callable($this->_mapping[$char])) {
         $mapping = $this->_mapping[$char];
         return $mapping($this);
     }
     if (isset($this->_mapping[$char])) {
         $this->_buffer = $this->_mapping[$char];
     } elseif (false === Ustring::isCharPrintable($char)) {
         Console\Cursor::bip();
         return static::STATE_CONTINUE | static::STATE_NO_ECHO;
     }
     if ($this->getLineLength() == $this->getLineCurrent()) {
         $this->appendLine($this->_buffer);
         return static::STATE_CONTINUE;
     }
     $this->insertLine($this->_buffer);
     $tail = mb_substr($this->getLine(), $this->getLineCurrent() - 1);
     $this->_buffer = "" . $tail . str_repeat("", mb_strlen($tail) - 1);
     return static::STATE_CONTINUE;
 }