Commit 62491880 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: bundle some settings for a new buffer

No related merge requests found
Showing with 3 additions and 7 deletions
+3 -7
......@@ -475,11 +475,6 @@ bool open_buffer(const char *filename, bool undoable)
rc = (filename[0] != '\0' && !ISSET(NOREAD_MODE)) ?
open_file(realname, new_buffer, inhelp, &f) : -2;
/* If we have a file, and we're loading into a new buffer, update
* the filename. */
if (rc != -1 && new_buffer)
openfile->filename = mallocstrcpy(openfile->filename, realname);
/* If we have a non-new file, read it in. Then, if the buffer has
* no stat, update the stat, if applicable. */
if (rc > 0) {
......@@ -490,9 +485,10 @@ bool open_buffer(const char *filename, bool undoable)
#endif
}
/* If we have a file, and we're loading into a new buffer, move back
* to the beginning of the first line of the buffer. */
/* If we have a file, and we've loaded it into a new buffer, set
* the filename and put the cursor at the start of the buffer. */
if (rc != -1 && new_buffer) {
openfile->filename = mallocstrcpy(openfile->filename, realname);
openfile->current = openfile->fileage;
openfile->current_x = 0;
openfile->placewewant = 0;
......
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