0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.2-120

This commit is contained in:
Bram Moolenaar 2009-02-22 01:37:59 +00:00
parent ffcce30fdb
commit 884ae6446f
4 changed files with 31 additions and 16 deletions

View File

@ -1419,6 +1419,7 @@ qf_jump(qi, dir, errornr, forceit)
int opened_window = FALSE; int opened_window = FALSE;
win_T *win; win_T *win;
win_T *altwin; win_T *altwin;
int flags;
#endif #endif
win_T *oldwin = curwin; win_T *oldwin = curwin;
int print_message = TRUE; int print_message = TRUE;
@ -1531,7 +1532,6 @@ qf_jump(qi, dir, errornr, forceit)
if (qf_ptr->qf_type == 1 && (!curwin->w_buffer->b_help || cmdmod.tab != 0)) if (qf_ptr->qf_type == 1 && (!curwin->w_buffer->b_help || cmdmod.tab != 0))
{ {
win_T *wp; win_T *wp;
int n;
if (cmdmod.tab != 0) if (cmdmod.tab != 0)
wp = NULL; wp = NULL;
@ -1547,13 +1547,16 @@ qf_jump(qi, dir, errornr, forceit)
* Split off help window; put it at far top if no position * Split off help window; put it at far top if no position
* specified, the current window is vertically split and narrow. * specified, the current window is vertically split and narrow.
*/ */
n = WSP_HELP; flags = WSP_HELP;
# ifdef FEAT_VERTSPLIT # ifdef FEAT_VERTSPLIT
if (cmdmod.split == 0 && curwin->w_width != Columns if (cmdmod.split == 0 && curwin->w_width != Columns
&& curwin->w_width < 80) && curwin->w_width < 80)
n |= WSP_TOP; flags |= WSP_TOP;
# endif # endif
if (win_split(0, n) == FAIL) if (qi != &ql_info)
flags |= WSP_NEWLOC; /* don't copy the location list */
if (win_split(0, flags) == FAIL)
goto theend; goto theend;
opened_window = TRUE; /* close it when fail */ opened_window = TRUE; /* close it when fail */
@ -1563,7 +1566,6 @@ qf_jump(qi, dir, errornr, forceit)
if (qi != &ql_info) /* not a quickfix list */ if (qi != &ql_info) /* not a quickfix list */
{ {
/* The new window should use the supplied location list */ /* The new window should use the supplied location list */
qf_free_all(curwin);
curwin->w_llist = qi; curwin->w_llist = qi;
qi->qf_refcount++; qi->qf_refcount++;
} }
@ -1624,7 +1626,10 @@ win_found:
{ {
ll_ref = curwin->w_llist_ref; ll_ref = curwin->w_llist_ref;
if (win_split(0, WSP_ABOVE) == FAIL) flags = WSP_ABOVE;
if (ll_ref != NULL)
flags |= WSP_NEWLOC;
if (win_split(0, flags) == FAIL)
goto failed; /* not enough room for window */ goto failed; /* not enough room for window */
opened_window = TRUE; /* close it when fail */ opened_window = TRUE; /* close it when fail */
p_swb = empty_option; /* don't split again */ p_swb = empty_option; /* don't split again */
@ -1636,7 +1641,6 @@ win_found:
{ {
/* The new window should use the location list from the /* The new window should use the location list from the
* location list window */ * location list window */
qf_free_all(curwin);
curwin->w_llist = ll_ref; curwin->w_llist = ll_ref;
ll_ref->qf_refcount++; ll_ref->qf_refcount++;
} }
@ -2311,15 +2315,12 @@ ex_copen(eap)
if (eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow) if (eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow)
/* Create the new window at the very bottom. */ /* Create the new window at the very bottom. */
win_goto(lastwin); win_goto(lastwin);
if (win_split(height, WSP_BELOW) == FAIL) if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL)
return; /* not enough room for window */ return; /* not enough room for window */
#ifdef FEAT_SCROLLBIND #ifdef FEAT_SCROLLBIND
curwin->w_p_scb = FALSE; curwin->w_p_scb = FALSE;
#endif #endif
/* Remove the location list for the quickfix window */
qf_free_all(curwin);
if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
{ {
/* /*

View File

@ -676,6 +676,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
120,
/**/ /**/
119, 119,
/**/ /**/

View File

@ -1057,6 +1057,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define WSP_HELP 16 /* creating the help window */ #define WSP_HELP 16 /* creating the help window */
#define WSP_BELOW 32 /* put new window below/right */ #define WSP_BELOW 32 /* put new window below/right */
#define WSP_ABOVE 64 /* put new window above/left */ #define WSP_ABOVE 64 /* put new window above/left */
#define WSP_NEWLOC 128 /* don't copy location list */
/* /*
* arguments for gui_set_shellsize() * arguments for gui_set_shellsize()

View File

@ -12,7 +12,7 @@
static int path_is_url __ARGS((char_u *p)); static int path_is_url __ARGS((char_u *p));
#if defined(FEAT_WINDOWS) || defined(PROTO) #if defined(FEAT_WINDOWS) || defined(PROTO)
static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir)); static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
static void win_init __ARGS((win_T *newp, win_T *oldp)); static void win_init __ARGS((win_T *newp, win_T *oldp, int flags));
static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col)); static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col));
static void frame_setheight __ARGS((frame_T *curfrp, int height)); static void frame_setheight __ARGS((frame_T *curfrp, int height));
#ifdef FEAT_VERTSPLIT #ifdef FEAT_VERTSPLIT
@ -911,7 +911,7 @@ win_split_ins(size, flags, newwin, dir)
return FAIL; return FAIL;
/* make the contents of the new window the same as the current one */ /* make the contents of the new window the same as the current one */
win_init(wp, curwin); win_init(wp, curwin, flags);
} }
/* /*
@ -1160,11 +1160,15 @@ win_split_ins(size, flags, newwin, dir)
* Initialize window "newp" from window "oldp". * Initialize window "newp" from window "oldp".
* Used when splitting a window and when creating a new tab page. * Used when splitting a window and when creating a new tab page.
* The windows will both edit the same buffer. * The windows will both edit the same buffer.
* WSP_NEWLOC may be specified in flags to prevent the location list from
* being copied.
*/ */
/*ARGSUSED*/
static void static void
win_init(newp, oldp) win_init(newp, oldp, flags)
win_T *newp; win_T *newp;
win_T *oldp; win_T *oldp;
int flags;
{ {
int i; int i;
@ -1189,6 +1193,13 @@ win_init(newp, oldp)
copy_jumplist(oldp, newp); copy_jumplist(oldp, newp);
#endif #endif
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
if (flags & WSP_NEWLOC)
{
/* Don't copy the location list. */
newp->w_llist = NULL;
newp->w_llist_ref = NULL;
}
else
copy_loclist(oldp, newp); copy_loclist(oldp, newp);
#endif #endif
if (oldp->w_localdir != NULL) if (oldp->w_localdir != NULL)
@ -3219,7 +3230,7 @@ win_alloc_firstwin(oldwin)
else else
{ {
/* First window in new tab page, initialize it from "oldwin". */ /* First window in new tab page, initialize it from "oldwin". */
win_init(curwin, oldwin); win_init(curwin, oldwin, 0);
# ifdef FEAT_SCROLLBIND # ifdef FEAT_SCROLLBIND
/* We don't want scroll-binding in the first window. */ /* We don't want scroll-binding in the first window. */