start cmd. Execute "gvim -U NONE -u NONE test.c". Notice that test.c
must not exist.
:set ff=unix
:w
:echo&modified
Then it shows "1". But if I don't execute ":set ff=unix", then ":echo
&modified" shows 0. Is it supposed to be like this?
That is weird. On Unix it happens with ":set ff=dos".
Bram, the problem is that save_file_ff() at misc1.c:3073 isn't called.
It's not called because file_ff_differs() at option.c:11496 returns
false for an empty buffer. So an unchanged empty buffer will not have
save_file_ff() called, but should. One possible fix is below.
Ben.
diff -r 239e56f593ee src/misc1.c
--- a/src/misc1.c Tue Jan 18 22:18:14 2011 +1100
+++ b/src/misc1.c Fri Jan 21 22:19:34 2011 +1100
@@ -3065,7 +3065,11 @@
buf_T *buf;
int ff; /* also reset 'fileformat' */
{
- if (buf->b_changed || (ff && file_ff_differs(buf)))
+ if (buf->b_changed || (ff &&
+ (file_ff_differs(buf) ||
+ ((buf->b_flags & BF_NEW)
+ && buf->b_ml.ml_line_count == 1
+ && *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL))))
{
buf->b_changed = 0;
ml_setflags(buf);
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php