Skip to content

Commit 5a65686

Browse files
committed
patch 8.0.1508: the :drop command is not always available
Problem: The :drop command is not always available. Solution: Include :drop in all builds. (Yasuhiro Matsumoto, closes #2639)
1 parent bfbea56 commit 5a65686

7 files changed

Lines changed: 34 additions & 45 deletions

File tree

runtime/doc/windows.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,6 @@ can also get to them with the buffer list commands, like ":bnext".
711711
When using the |:tab| modifier each argument is opened in a
712712
tab page. The last window is used if it's empty.
713713
Also see |++opt| and |+cmd|.
714-
{only available when compiled with a GUI}
715714

716715
==============================================================================
717716
8. Do a command in all buffers or windows *list-repeat*

src/ex_cmds.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8335,7 +8335,6 @@ ex_smile(exarg_T *eap UNUSED)
83358335
msg_clr_eos();
83368336
}
83378337

8338-
#if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO)
83398338
/*
83408339
* ":drop"
83418340
* Opens the first argument in a window. When there are two or more arguments
@@ -8415,7 +8414,6 @@ ex_drop(exarg_T *eap)
84158414
ex_rewind(eap);
84168415
}
84178416
}
8418-
#endif
84198417

84208418
/*
84218419
* Skip over the pattern argument of ":vimgrep /pat/[g][j]".

src/ex_cmds2.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,7 +2549,6 @@ get_arglist_exp(
25492549
}
25502550
#endif
25512551

2552-
#if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO)
25532552
/*
25542553
* Redefine the argument list.
25552554
*/
@@ -2558,7 +2557,6 @@ set_arglist(char_u *str)
25582557
{
25592558
do_arglist(str, AL_SET, 0);
25602559
}
2561-
#endif
25622560

25632561
/*
25642562
* "what" == AL_SET: Redefine the argument list to 'str'.

src/ex_docmd.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,6 @@ static void ex_wrongmodifier(exarg_T *eap);
201201
static void ex_find(exarg_T *eap);
202202
static void ex_open(exarg_T *eap);
203203
static void ex_edit(exarg_T *eap);
204-
#if !defined(FEAT_GUI) && !defined(FEAT_CLIENTSERVER)
205-
# define ex_drop ex_ni
206-
#endif
207204
#ifndef FEAT_GUI
208205
# define ex_gui ex_nogui
209206
static void ex_nogui(exarg_T *eap);

src/testdir/test_normal.vim

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,9 +2176,6 @@ func! Test_normal44_textobjects2()
21762176
endfunc
21772177

21782178
func! Test_normal45_drop()
2179-
if !has("dnd")
2180-
return
2181-
endif
21822179
" basic test for :drop command
21832180
" unfortunately, without a gui, we can't really test much here,
21842181
" so simply test that ~p fails (which uses the drop register)

src/testdir/test_tabpage.vim

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -41,40 +41,38 @@ function Test_tabpage()
4141
call assert_true(t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green'])
4242
tabclose
4343

44-
if has('gui') || has('clientserver')
45-
" Test for ":tab drop exist-file" to keep current window.
46-
sp test1
47-
tab drop test1
48-
call assert_true(tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1)
49-
close
50-
"
51-
"
52-
" Test for ":tab drop new-file" to keep current window of tabpage 1.
53-
split
54-
tab drop newfile
55-
call assert_true(tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1)
56-
tabclose
57-
q
58-
"
59-
"
60-
" Test for ":tab drop multi-opend-file" to keep current tabpage and window.
61-
new test1
62-
tabnew
63-
new test1
64-
tab drop test1
65-
call assert_true(tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1)
66-
tabclose
67-
q
68-
"
69-
"
70-
" Test for ":tab drop vertical-split-window" to jump test1 buffer
71-
tabedit test1
72-
vnew
73-
tabfirst
74-
tab drop test1
75-
call assert_equal([2, 2, 2, 2], [tabpagenr('$'), tabpagenr(), tabpagewinnr(2, '$'), tabpagewinnr(2)])
76-
1tabonly
77-
endif
44+
" Test for ":tab drop exist-file" to keep current window.
45+
sp test1
46+
tab drop test1
47+
call assert_true(tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1)
48+
close
49+
"
50+
"
51+
" Test for ":tab drop new-file" to keep current window of tabpage 1.
52+
split
53+
tab drop newfile
54+
call assert_true(tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1)
55+
tabclose
56+
q
57+
"
58+
"
59+
" Test for ":tab drop multi-opend-file" to keep current tabpage and window.
60+
new test1
61+
tabnew
62+
new test1
63+
tab drop test1
64+
call assert_true(tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1)
65+
tabclose
66+
q
67+
"
68+
"
69+
" Test for ":tab drop vertical-split-window" to jump test1 buffer
70+
tabedit test1
71+
vnew
72+
tabfirst
73+
tab drop test1
74+
call assert_equal([2, 2, 2, 2], [tabpagenr('$'), tabpagenr(), tabpagewinnr(2, '$'), tabpagewinnr(2)])
75+
1tabonly
7876
"
7977
"
8078
for i in range(9) | tabnew | endfor

src/version.c

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

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1508,
774776
/**/
775777
1507,
776778
/**/

0 commit comments

Comments
 (0)