aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-24 07:29:33 +0800
committerGitHub <noreply@github.com>2024-01-24 07:29:33 +0800
commit65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b (patch)
treebf5999ea603cd484c19148687a0dd83c0d8fecc1 /src/nvim/ex_cmds2.c
parent6cbfe454542ff498a84b22f0aff1bf215e883485 (diff)
downloadrneovim-65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b.tar.gz
rneovim-65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b.tar.bz2
rneovim-65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b.zip
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 https://github.com/vim/vim/commit/f96dc8d07f752ddd96d1447d85278a85255a1462 Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r--src/nvim/ex_cmds2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 234a927291..842f8a4297 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -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;
}
}