Added check to prevent page down from looping endlessly
This commit is contained in:
2
editor.c
2
editor.c
@@ -124,7 +124,7 @@ void page_down_handler(Buffer* buffer) {
|
|||||||
once, so this hardcoded statement is fine. */
|
once, so this hardcoded statement is fine. */
|
||||||
|
|
||||||
|
|
||||||
while (*(buffer->start - 1) != '\n') {
|
while ((*(buffer->start - 1) != '\n') && (buffer->end != (buffer->text + buffer->size))) {
|
||||||
buffer_right(buffer);
|
buffer_right(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user