Commit 2a7c9b7f authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment