mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
vim-patch:9.1.0046: :drop does not re-use empty buffer (#27165)
Problem: :drop does not re-use empty buffer
(Rocco Mao)
Solution: Make :drop re-use an empty buffer
(Rocco Mao)
fixes: vim/vim#13851
closes: vim/vim#13881
f96dc8d07f
Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
This commit is contained in:
@@ -477,7 +477,7 @@ static int do_arglist(char *str, int what, int after, bool will_edit)
|
||||
/// Redefine the argument list.
|
||||
void set_arglist(char *str)
|
||||
{
|
||||
do_arglist(str, AL_SET, 0, false);
|
||||
do_arglist(str, AL_SET, 0, true);
|
||||
}
|
||||
|
||||
/// @return true if window "win" is editing the file at the current argument
|
||||
|
@@ -799,8 +799,7 @@ static void script_host_do_range(char *name, exarg_T *eap)
|
||||
}
|
||||
|
||||
/// ":drop"
|
||||
/// Opens the first argument in a window. When there are two or more arguments
|
||||
/// the argument list is redefined.
|
||||
/// Opens the first argument in a window, and the argument list is redefined.
|
||||
void ex_drop(exarg_T *eap)
|
||||
{
|
||||
bool split = false;
|
||||
@@ -825,6 +824,8 @@ void ex_drop(exarg_T *eap)
|
||||
// edited in a window yet. It's like ":tab all" but without closing
|
||||
// windows or tabs.
|
||||
ex_all(eap);
|
||||
cmdmod.cmod_tab = 0;
|
||||
ex_rewind(eap);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -845,6 +846,7 @@ void ex_drop(exarg_T *eap)
|
||||
buf_check_timestamp(curbuf);
|
||||
curbuf->b_p_ar = save_ar;
|
||||
}
|
||||
ex_rewind(eap);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user