diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-03-02 22:40:52 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-03-02 22:40:52 +0000 |
commit | b475fb917b0de463812afe6cc84b8e604d780da9 (patch) | |
tree | fc5bc286bbbe623ccd5edb6de7c21c233f144edf /src/buffer.c | |
parent | 261bfeab3ed2293019f6ea4b89c49d85ef116745 (diff) |
updated for version 7.0212
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/src/buffer.c b/src/buffer.c index 7e214a6cc2..5d3ddd62f0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4454,12 +4454,16 @@ ex_buffer_all(eap) ? wp->w_height + wp->w_status_height < Rows - p_ch : wp->w_width != Columns) #endif +#ifdef FEAT_WINDOWS + || (had_tab > 0 && wp != firstwin) +#endif ) { win_close(wp, FALSE); #ifdef FEAT_AUTOCMD wpnext = firstwin; /* just in case an autocommand does something strange with windows */ + tpnext = first_tabpage; /* start all over...*/ open_wins = 0; #endif } @@ -4471,12 +4475,6 @@ ex_buffer_all(eap) /* Without the ":tab" modifier only do the current tab page. */ if (had_tab == 0 || tpnext == NULL) break; - -# ifdef FEAT_AUTOCMD - /* check if autocommands removed the next tab page */ - if (!valid_tabpage(tpnext)) - tpnext = first_tabpage; /* start all over...*/ -# endif goto_tabpage_tp(tpnext); } #endif @@ -4500,14 +4498,28 @@ ex_buffer_all(eap) if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl) continue; - /* Check if this buffer already has a window */ - for (wp = firstwin; wp != NULL; wp = wp->w_next) - if (wp->w_buffer == buf) - break; - /* If the buffer already has a window, move it */ - if (wp != NULL) - win_move_after(wp, curwin); - else if (split_ret == OK) +#ifdef FEAT_WINDOWS + if (had_tab != 0) + { + /* With the ":tab" modifier don't move the window. */ + if (buf->b_nwindows > 0) + wp = lastwin; /* buffer has a window, skip it */ + else + wp = NULL; + } + else +#endif + { + /* Check if this buffer already has a window */ + for (wp = firstwin; wp != NULL; wp = wp->w_next) + if (wp->w_buffer == buf) + break; + /* If the buffer already has a window, move it */ + if (wp != NULL) + win_move_after(wp, curwin); + } + + if (wp == NULL && split_ret == OK) { /* Split the window and put the buffer in it */ p_ea_save = p_ea; |