summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-03-11 21:16:47 +0000
committerBram Moolenaar <Bram@vim.org>2006-03-11 21:16:47 +0000
commit8ee8926785586c73354b67ac401bb692f893bea0 (patch)
tree24010bd749b69e235bbe5ee146e6fdc22d399d6f
parentade0083d3ad61d86368a77bd1e499231eea9a3eb (diff)
downloadvim-8ee8926785586c73354b67ac401bb692f893bea0.zip
updated for version 7.0221
-rw-r--r--src/buffer.c38
-rw-r--r--src/proto/buffer.pro4
-rw-r--r--src/proto/popupmenu.pro3
3 files changed, 33 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 089def07d..6010dbd40 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4178,9 +4178,10 @@ alist_name(aep)
* do_arg_all(): Open up to 'count' windows, one for each argument.
*/
void
-do_arg_all(count, forceit)
+do_arg_all(count, forceit, keep_tabs)
int count;
int forceit; /* hide buffers in current windows */
+ int keep_tabs; /* keep curren tabs, for ":tab drop file" */
{
int i;
win_T *wp, *wpnext;
@@ -4193,6 +4194,8 @@ do_arg_all(count, forceit)
buf_T *buf;
tabpage_T *tpnext;
int had_tab = cmdmod.tab;
+ win_T *new_curwin = NULL;
+ tabpage_T *new_curtab = NULL;
if (ARGCOUNT <= 0)
{
@@ -4241,10 +4244,17 @@ do_arg_all(count, forceit)
{
if (ARGLIST[i].ae_fnum == buf->b_fnum
|| fullpathcmp(alist_name(&ARGLIST[i]),
- buf->b_ffname, TRUE) & FPC_SAME)
+ buf->b_ffname, TRUE) & FPC_SAME)
{
if (i < opened_len)
+ {
opened[i] = TRUE;
+ if (i == 0)
+ {
+ new_curwin = wp;
+ new_curtab = curtab;
+ }
+ }
if (wp->w_alist != curwin->w_alist)
{
/* Use the current argument list for all windows
@@ -4259,14 +4269,15 @@ do_arg_all(count, forceit)
}
wp->w_arg_idx = i;
- if (i == ARGCOUNT) /* close this window */
+ if (i == ARGCOUNT && !keep_tabs) /* close this window */
{
if (P_HID(buf) || forceit || buf->b_nwindows > 1
- || !bufIsChanged(buf))
+ || !bufIsChanged(buf))
{
/* If the buffer was changed, and we would like to hide it,
* try autowriting. */
- if (!P_HID(buf) && buf->b_nwindows <= 1 && bufIsChanged(buf))
+ if (!P_HID(buf) && buf->b_nwindows <= 1
+ && bufIsChanged(buf))
{
(void)autowrite(buf, FALSE);
#ifdef FEAT_AUTOCMD
@@ -4279,7 +4290,8 @@ do_arg_all(count, forceit)
#endif
}
#ifdef FEAT_WINDOWS
- if (firstwin == lastwin) /* don't close last window */
+ /* don't close last window */
+ if (firstwin == lastwin && first_tabpage->tp_next == NULL)
#endif
use_firstwin = TRUE;
#ifdef FEAT_WINDOWS
@@ -4364,9 +4376,14 @@ do_arg_all(count, forceit)
#endif
/*
- * edit file i
+ * edit file "i"
*/
curwin->w_arg_idx = i;
+ if (i == 0)
+ {
+ new_curwin = curwin;
+ new_curtab = curtab;
+ }
(void)do_ecmd(0, alist_name(&AARGLIST(alist)[i]), NULL, NULL,
ECMD_ONE,
((P_HID(curwin->w_buffer)
@@ -4391,7 +4408,12 @@ do_arg_all(count, forceit)
#ifdef FEAT_AUTOCMD
--autocmd_no_enter;
#endif
- win_enter(firstwin, FALSE); /* back to first window */
+ /* to window with first arg */
+ if (valid_tabpage(new_curtab))
+ goto_tabpage_tp(new_curtab);
+ if (win_valid(new_curwin))
+ win_enter(new_curwin, FALSE);
+
#ifdef FEAT_AUTOCMD
--autocmd_no_leave;
#endif
diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro
index 73ad5306e..91934432d 100644
--- a/src/proto/buffer.pro
+++ b/src/proto/buffer.pro
@@ -46,9 +46,9 @@ int append_arg_number __ARGS((win_T *wp, char_u *buf, int add_file, int maxlen))
char_u *fix_fname __ARGS((char_u *fname));
void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
char_u *alist_name __ARGS((aentry_T *aep));
-void do_arg_all __ARGS((int count, int forceit));
+void do_arg_all __ARGS((int count, int forceit, int keep_tabs));
void ex_buffer_all __ARGS((exarg_T *eap));
-void do_modelines __ARGS((int win_only));
+void do_modelines __ARGS((int flags));
int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
void write_viminfo_bufferlist __ARGS((FILE *fp));
char *buf_spname __ARGS((buf_T *buf));
diff --git a/src/proto/popupmenu.pro b/src/proto/popupmenu.pro
index 05f9eabb3..f332d3c90 100644
--- a/src/proto/popupmenu.pro
+++ b/src/proto/popupmenu.pro
@@ -1,7 +1,6 @@
/* popupmenu.c */
-void pum_display __ARGS((pumitem_T *array, int size, int selected, int row, int height, int col));
+void pum_display __ARGS((pumitem_T *array, int size, int selected));
void pum_redraw __ARGS((void));
-void pum_set_selected __ARGS((int n));
void pum_undisplay __ARGS((void));
void pum_clear __ARGS((void));
int pum_visible __ARGS((void));