diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-09-02 19:12:26 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-09-02 19:12:26 +0000 |
commit | d4755bb0e04fca334675f1503bd6474b017a9bba (patch) | |
tree | 8be8df859191e78ee9eef80d3b341fd5d0c1b81b /src/buffer.c | |
parent | 269ec658f0fad22b2bf9f71b06a4e6e10277f0e5 (diff) | |
download | vim-git-d4755bb0e04fca334675f1503bd6474b017a9bba.tar.gz |
updated for version 7.0014
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index c2bc09473..007afd635 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1262,7 +1262,8 @@ set_curbuf(buf, action) || action == DOBUF_WIPE); setpcmark(); - curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */ + if (!cmdmod.keepalt) + curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */ buflist_altfpos(); /* remember curpos */ #ifdef FEAT_VISUAL @@ -1345,7 +1346,15 @@ enter_buffer(buf) /* Make sure the buffer is loaded. */ if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */ + { + /* If there is no filetype, allow for detecting one. Esp. useful for + * ":ball" used in a autocommand. If there already is a filetype we + * might prefer to keep it. */ + if (*curbuf->b_p_ft == NUL) + did_filetype = FALSE; + open_buffer(FALSE, NULL); + } else { need_fileinfo = TRUE; /* display file info after redraw */ @@ -2536,7 +2545,7 @@ setaltfname(ffname, sfname, lnum) /* Create a buffer. 'buflisted' is not set if it's a new buffer */ buf = buflist_new(ffname, sfname, lnum, 0); - if (buf != NULL) + if (buf != NULL && !cmdmod.keepalt) curwin->w_alt_fnum = buf->b_fnum; return buf; } |