summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-02-22 08:39:57 +0000
committerBram Moolenaar <Bram@vim.org>2005-02-22 08:39:57 +0000
commitdf177f679e950a2ab2ad5fe7d45c1daface004d7 (patch)
tree21c0c50e9144ef873af675daf53b86beb26dd677 /src/fileio.c
parent6bdcfc08cb9c192972336e28a2a842b7abbb2811 (diff)
downloadvim-git-df177f679e950a2ab2ad5fe7d45c1daface004d7.tar.gz
updated for version 7.0051
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 9dd1d4975..064468870 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -140,10 +140,6 @@ static int get_mac_fio_flags __ARGS((char_u *ptr));
#endif
static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf));
-static linenr_T write_no_eol_lnum = 0; /* non-zero lnum when last line of
- next binary write should not have
- an end-of-line */
-
void
filemess(buf, name, s, attr)
buf_T *buf;
@@ -288,9 +284,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
int conv_restlen = 0; /* nr of bytes in conv_rest[] */
#endif
-#ifdef FEAT_AUTOCMD
write_no_eol_lnum = 0; /* in case it was set by the previous read */
-#endif
/*
* If there is no file name yet, use the one for the read file.
@@ -308,6 +302,10 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
curbuf->b_flags |= BF_NOTEDITED;
}
+ /* After reading a file the cursor line changes but we don't want to
+ * display the line. */
+ ex_no_reprint = TRUE;
+
/*
* For Unix: Use the short file name whenever possible.
* Avoids problems with networks and when directory names are changed.
@@ -2230,7 +2228,6 @@ failed:
check_marks_read();
#endif
-#ifdef FEAT_AUTOCMD
/*
* Trick: We remember if the last line of the read didn't have
* an eol for when writing it again. This is required for
@@ -2238,6 +2235,7 @@ failed:
*/
write_no_eol_lnum = read_no_eol_lnum;
+#ifdef FEAT_AUTOCMD
if (!read_stdin && !read_buffer)
{
int m = msg_scroll;
@@ -2628,6 +2626,10 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
# endif
#endif
+ /* After writing a file changedtick changes but we don't want to display
+ * the line. */
+ ex_no_reprint = TRUE;
+
/*
* If there is no file name yet, use the one for the written file.
* BF_NOTEDITED is set to reflect this (in case the write fails).
@@ -6267,7 +6269,7 @@ buf_store_time(buf, st, fname)
write_lnum_adjust(offset)
linenr_T offset;
{
- if (write_no_eol_lnum) /* only if there is a missing eol */
+ if (write_no_eol_lnum != 0) /* only if there is a missing eol */
write_no_eol_lnum += offset;
}