Fix page down behavior, resolves #1
All checks were successful
timw4mail/php-kilo/pipeline/head This commit looks good

This commit is contained in:
Timothy Warren 2021-04-16 12:51:53 -04:00
parent 4812d548a7
commit 228576ccf1

View File

@ -778,7 +778,7 @@ class Editor {
break;
default:
// Do nothing
return;
}
// Snap cursor to the end of a row when moving
@ -792,8 +792,9 @@ class Editor {
}
$this->cursor->x = $x;
$this->cursor->y = $y;
}
$this->cursor->y = ($y >= $this->document->numRows) ? $this->document->numRows - 1 : $y;
}
protected function insertChar(string $c): void