1
1

files: don't bother counting rows when opening a fresh buffer

Counting the added number of rows is only relevant when inserting
a file into the current buffer.  So don't waste time counting when
it's not needed.

This fixes https://savannah.gnu.org/bugs/?51479.
Этот коммит содержится в:
Benno Schulenberg 2017-07-17 21:14:14 +02:00
родитель 1146381765
Коммит 2a7c9b7f62

Просмотреть файл

@ -926,7 +926,7 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable,
(unsigned long)num_lines), (unsigned long)num_lines);
/* If we inserted less than a screenful, don't center the cursor. */
if (less_than_a_screenful(was_lineno, was_leftedge))
if (undoable && less_than_a_screenful(was_lineno, was_leftedge))
focusing = FALSE;
#ifndef NANO_TINY