Fix page down behavior, resolves #1
timw4mail/php-kilo/pipeline/head This commit looks good Details

This commit is contained in:
Timothy Warren 2021-04-16 12:51:53 -04:00
parent 4812d548a7
commit 228576ccf1
1 changed files with 3 additions and 2 deletions

View File

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