Skip to content

Commit 1f7e0c9

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 365fede + 92cbf62 commit 1f7e0c9

5 files changed

Lines changed: 149 additions & 98 deletions

File tree

Filelist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ SRC_ALL = \
228228
src/libvterm/src/parser.c \
229229
src/libvterm/src/pen.c \
230230
src/libvterm/src/rect.h \
231-
src/libvterm/src/screen.c \
231+
src/libvterm/src/termscreen.c \
232232
src/libvterm/src/state.c \
233233
src/libvterm/src/unicode.c \
234234
src/libvterm/src/utf8.h \

src/gui_gtk_x11.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3415,6 +3415,7 @@ on_select_tab(
34153415
send_tabline_event(idx + 1);
34163416
}
34173417

3418+
# if GTK_CHECK_VERSION(2,10,0)
34183419
/*
34193420
* Handle reordering the tabs (using D&D).
34203421
*/
@@ -3433,6 +3434,7 @@ on_tab_reordered(
34333434
tabpage_move(idx);
34343435
}
34353436
}
3437+
# endif
34363438

34373439
/*
34383440
* Show or hide the tabline.
@@ -3516,9 +3518,11 @@ gui_mch_update_tabline(void)
35163518
page,
35173519
event_box,
35183520
nr++);
3521+
# if GTK_CHECK_VERSION(2,10,0)
35193522
gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(gui.tabline),
35203523
page,
35213524
TRUE);
3525+
# endif
35223526
}
35233527

35243528
event_box = gtk_notebook_get_tab_label(GTK_NOTEBOOK(gui.tabline), page);
@@ -3914,13 +3918,17 @@ gui_mch_init(void)
39143918
# endif
39153919
gtk_container_add(GTK_CONTAINER(event_box), label);
39163920
gtk_notebook_set_tab_label(GTK_NOTEBOOK(gui.tabline), page, event_box);
3921+
# if GTK_CHECK_VERSION(2,10,0)
39173922
gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(gui.tabline), page, TRUE);
3923+
# endif
39183924
}
39193925

39203926
g_signal_connect(G_OBJECT(gui.tabline), "switch-page",
39213927
G_CALLBACK(on_select_tab), NULL);
3928+
# if GTK_CHECK_VERSION(2,10,0)
39223929
g_signal_connect(G_OBJECT(gui.tabline), "page-reordered",
39233930
G_CALLBACK(on_tab_reordered), NULL);
3931+
# endif
39243932

39253933
/* Create a popup menu for the tab line and connect it. */
39263934
tabline_menu = create_tabline_menu();
@@ -6395,7 +6403,11 @@ gui_mch_wait_for_chars(long wtime)
63956403
gui_mch_flush(void)
63966404
{
63976405
if (gui.mainwin != NULL && gtk_widget_get_realized(gui.mainwin))
6406+
#if GTK_CHECK_VERSION(2,4,0)
63986407
gdk_display_flush(gtk_widget_get_display(gui.mainwin));
6408+
#else
6409+
gdk_display_sync(gtk_widget_get_display(gui.mainwin));
6410+
#endif
63996411
}
64006412

64016413
/*

src/quickfix.c

Lines changed: 117 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -3806,6 +3806,112 @@ qf_set_title_var(qf_list_T *qfl)
38063806
set_internal_string_var((char_u *)"w:quickfix_title", qfl->qf_title);
38073807
}
38083808

3809+
/*
3810+
* Goto a quickfix or location list window (if present).
3811+
* Returns OK if the window is found, FAIL otherwise.
3812+
*/
3813+
static int
3814+
qf_goto_cwindow(qf_info_T *qi, int resize, int sz, int vertsplit)
3815+
{
3816+
win_T *win;
3817+
3818+
win = qf_find_win(qi);
3819+
if (win == NULL)
3820+
return FAIL;
3821+
3822+
win_goto(win);
3823+
if (resize)
3824+
{
3825+
if (vertsplit)
3826+
{
3827+
if (sz != win->w_width)
3828+
win_setwidth(sz);
3829+
}
3830+
else if (sz != win->w_height)
3831+
win_setheight(sz);
3832+
}
3833+
3834+
return OK;
3835+
}
3836+
3837+
/*
3838+
* Open a new quickfix or location list window, load the quickfix buffer and
3839+
* set the appropriate options for the window.
3840+
* Returns FAIL if the window could not be opened.
3841+
*/
3842+
static int
3843+
qf_open_new_cwindow(qf_info_T *qi, int height)
3844+
{
3845+
buf_T *qf_buf;
3846+
win_T *oldwin = curwin;
3847+
tabpage_T *prevtab = curtab;
3848+
int flags = 0;
3849+
win_T *win;
3850+
3851+
qf_buf = qf_find_buf(qi);
3852+
3853+
// The current window becomes the previous window afterwards.
3854+
win = curwin;
3855+
3856+
if (IS_QF_STACK(qi) && cmdmod.split == 0)
3857+
// Create the new quickfix window at the very bottom, except when
3858+
// :belowright or :aboveleft is used.
3859+
win_goto(lastwin);
3860+
// Default is to open the window below the current window
3861+
if (cmdmod.split == 0)
3862+
flags = WSP_BELOW;
3863+
flags |= WSP_NEWLOC;
3864+
if (win_split(height, flags) == FAIL)
3865+
return FAIL; // not enough room for window
3866+
RESET_BINDING(curwin);
3867+
3868+
if (IS_LL_STACK(qi))
3869+
{
3870+
// For the location list window, create a reference to the
3871+
// location list from the window 'win'.
3872+
curwin->w_llist_ref = win->w_llist;
3873+
win->w_llist->qf_refcount++;
3874+
}
3875+
3876+
if (oldwin != curwin)
3877+
oldwin = NULL; // don't store info when in another window
3878+
if (qf_buf != NULL)
3879+
{
3880+
// Use the existing quickfix buffer
3881+
(void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE,
3882+
ECMD_HIDE + ECMD_OLDBUF, oldwin);
3883+
}
3884+
else
3885+
{
3886+
// Create a new quickfix buffer
3887+
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, oldwin);
3888+
3889+
// switch off 'swapfile'
3890+
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
3891+
set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
3892+
OPT_LOCAL);
3893+
set_option_value((char_u *)"bh", 0L, (char_u *)"wipe", OPT_LOCAL);
3894+
RESET_BINDING(curwin);
3895+
#ifdef FEAT_DIFF
3896+
curwin->w_p_diff = FALSE;
3897+
#endif
3898+
#ifdef FEAT_FOLDING
3899+
set_option_value((char_u *)"fdm", 0L, (char_u *)"manual",
3900+
OPT_LOCAL);
3901+
#endif
3902+
}
3903+
3904+
// Only set the height when still in the same tab page and there is no
3905+
// window to the side.
3906+
if (curtab == prevtab && curwin->w_width == Columns)
3907+
win_setheight(height);
3908+
curwin->w_p_wfh = TRUE; // set 'winfixheight'
3909+
if (win_valid(win))
3910+
prevwin = win;
3911+
3912+
return OK;
3913+
}
3914+
38093915
/*
38103916
* ":copen": open a window that shows the list of errors.
38113917
* ":lopen": open a window that shows the location list.
@@ -3815,10 +3921,7 @@ ex_copen(exarg_T *eap)
38153921
{
38163922
qf_info_T *qi = &ql_info;
38173923
int height;
3818-
win_T *win;
3819-
tabpage_T *prevtab = curtab;
3820-
buf_T *qf_buf;
3821-
win_T *oldwin = curwin;
3924+
int status = FAIL;
38223925

38233926
if (is_loclist_cmd(eap->cmdidx))
38243927
{
@@ -3835,107 +3938,28 @@ ex_copen(exarg_T *eap)
38353938
else
38363939
height = QF_WINHEIGHT;
38373940

3838-
reset_VIsual_and_resel(); /* stop Visual mode */
3941+
reset_VIsual_and_resel(); // stop Visual mode
38393942
#ifdef FEAT_GUI
38403943
need_mouse_correct = TRUE;
38413944
#endif
38423945

3843-
/*
3844-
* Find existing quickfix window, or open a new one.
3845-
*/
3846-
win = qf_find_win(qi);
3847-
3848-
if (win != NULL && cmdmod.tab == 0)
3849-
{
3850-
win_goto(win);
3851-
if (eap->addr_count != 0)
3852-
{
3853-
if (cmdmod.split & WSP_VERT)
3854-
{
3855-
if (height != win->w_width)
3856-
win_setwidth(height);
3857-
}
3858-
else if (height != win->w_height)
3859-
win_setheight(height);
3860-
}
3861-
}
3862-
else
3863-
{
3864-
int flags = 0;
3865-
3866-
qf_buf = qf_find_buf(qi);
3867-
3868-
/* The current window becomes the previous window afterwards. */
3869-
win = curwin;
3870-
3871-
if ((eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow)
3872-
&& cmdmod.split == 0)
3873-
/* Create the new quickfix window at the very bottom, except when
3874-
* :belowright or :aboveleft is used. */
3875-
win_goto(lastwin);
3876-
/* Default is to open the window below the current window */
3877-
if (cmdmod.split == 0)
3878-
flags = WSP_BELOW;
3879-
flags |= WSP_NEWLOC;
3880-
if (win_split(height, flags) == FAIL)
3881-
return; /* not enough room for window */
3882-
RESET_BINDING(curwin);
3883-
3884-
if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
3885-
{
3886-
/*
3887-
* For the location list window, create a reference to the
3888-
* location list from the window 'win'.
3889-
*/
3890-
curwin->w_llist_ref = win->w_llist;
3891-
win->w_llist->qf_refcount++;
3892-
}
3893-
3894-
if (oldwin != curwin)
3895-
oldwin = NULL; /* don't store info when in another window */
3896-
if (qf_buf != NULL)
3897-
/* Use the existing quickfix buffer */
3898-
(void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE,
3899-
ECMD_HIDE + ECMD_OLDBUF, oldwin);
3900-
else
3901-
{
3902-
/* Create a new quickfix buffer */
3903-
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, oldwin);
3904-
/* switch off 'swapfile' */
3905-
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
3906-
set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
3907-
OPT_LOCAL);
3908-
set_option_value((char_u *)"bh", 0L, (char_u *)"wipe", OPT_LOCAL);
3909-
RESET_BINDING(curwin);
3910-
#ifdef FEAT_DIFF
3911-
curwin->w_p_diff = FALSE;
3912-
#endif
3913-
#ifdef FEAT_FOLDING
3914-
set_option_value((char_u *)"fdm", 0L, (char_u *)"manual",
3915-
OPT_LOCAL);
3916-
#endif
3917-
}
3918-
3919-
/* Only set the height when still in the same tab page and there is no
3920-
* window to the side. */
3921-
if (curtab == prevtab && curwin->w_width == Columns)
3922-
win_setheight(height);
3923-
curwin->w_p_wfh = TRUE; /* set 'winfixheight' */
3924-
if (win_valid(win))
3925-
prevwin = win;
3926-
}
3946+
// Find an existing quickfix window, or open a new one.
3947+
if (cmdmod.tab == 0)
3948+
status = qf_goto_cwindow(qi, eap->addr_count != 0, height,
3949+
cmdmod.split & WSP_VERT);
3950+
if (status == FAIL)
3951+
if (qf_open_new_cwindow(qi, height) == FAIL)
3952+
return;
39273953

39283954
qf_set_title_var(&qi->qf_lists[qi->qf_curlist]);
39293955

3930-
/*
3931-
* Fill the buffer with the quickfix list.
3932-
*/
3956+
// Fill the buffer with the quickfix list.
39333957
qf_fill_buffer(qi, curbuf, NULL);
39343958

39353959
curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
39363960
curwin->w_cursor.col = 0;
39373961
check_cursor();
3938-
update_topline(); /* scroll to show the line */
3962+
update_topline(); // scroll to show the line
39393963
}
39403964

39413965
/*

src/testdir/test_startup.vim

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,16 +252,21 @@ func Test_p_arg()
252252
call delete('Xtestout')
253253
endfunc
254254

255-
" Test the -V[N] argument to set the 'version' option to [N]
255+
" Test the -V[N] argument to set the 'verbose' option to [N]
256256
func Test_V_arg()
257+
if has('gui_running')
258+
" Can't catch the output of gvim.
259+
return
260+
endif
257261
let out = system(GetVimCommand() . ' --clean -es -X -V0 -c "set verbose?" -cq')
258262
call assert_equal(" verbose=0\n", out)
259263

260264
let out = system(GetVimCommand() . ' --clean -es -X -V2 -c "set verbose?" -cq')
261-
call assert_match("^sourcing \"$VIMRUNTIME/defaults\.vim\"\r\nSearching for \"filetype\.vim\".*\n verbose=2\n$", out)
265+
call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\r\nSearching for \"filetype\.vim\".*\n", out)
266+
call assert_match(" verbose=2\n", out)
262267

263268
let out = system(GetVimCommand() . ' --clean -es -X -V15 -c "set verbose?" -cq')
264-
call assert_match("\+*\nsourcing \"$VIMRUNTIME/defaults\.vim\"\r\nline 1: \" The default vimrc file\..*\n verbose=15\n\+*", out)
269+
call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\r\nline 1: \" The default vimrc file\..* verbose=15\n", out)
265270
endfunc
266271

267272
" Test the -A, -F and -H arguments (Arabic, Farsi and Hebrew modes).
@@ -270,7 +275,9 @@ func Test_A_F_H_arg()
270275
\ 'call writefile([&rightleft, &arabic, &fkmap, &hkmap], "Xtestout")',
271276
\ 'qall',
272277
\ ]
273-
if has('arabic') && RunVim([], after, '-A')
278+
" Use silent Ex mode to avoid the hit-Enter prompt for the warning that
279+
" 'encoding' is not utf-8.
280+
if has('arabic') && &encoding == 'utf-8' && RunVim([], after, '-e -s -A')
274281
let lines = readfile('Xtestout')
275282
call assert_equal(['1', '1', '0', '0'], lines)
276283
endif

src/version.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,14 @@ static char *(features[]) =
809809

810810
static int included_patches[] =
811811
{ /* Add new patch number below this line */
812+
/**/
813+
412,
814+
/**/
815+
411,
816+
/**/
817+
410,
818+
/**/
819+
409,
812820
/**/
813821
408,
814822
/**/

0 commit comments

Comments
 (0)