aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/arglist.c
diff options
context:
space:
mode:
authorColin Kennedy <colinvfx@gmail.com>2023-12-25 20:41:09 -0800
committerzeertzjq <zeertzjq@outlook.com>2024-03-11 11:38:13 +0800
commit141182d6c6c06ad56413b81a518ba9b777a0cbe0 (patch)
tree451ef95315a55caf7ca95c9ef6eb8bedd48e77d9 /src/nvim/arglist.c
parenta09ddd7ce55037edc9747a682810fba6a26bc201 (diff)
downloadrneovim-141182d6c6c06ad56413b81a518ba9b777a0cbe0.tar.gz
rneovim-141182d6c6c06ad56413b81a518ba9b777a0cbe0.tar.bz2
rneovim-141182d6c6c06ad56413b81a518ba9b777a0cbe0.zip
vim-patch:9.1.0147: Cannot keep a buffer focused in a window
Problem: Cannot keep a buffer focused in a window (Amit Levy) Solution: Add the 'winfixbuf' window-local option (Colin Kennedy) fixes: vim/vim#6445 closes: vim/vim#13903 https://github.com/vim/vim/commit/215703563757a4464907ead6fb9edaeb7f430bea N/A patch: vim-patch:58f1e5c0893a
Diffstat (limited to 'src/nvim/arglist.c')
-rw-r--r--src/nvim/arglist.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/arglist.c b/src/nvim/arglist.c
index a02c22deae..4d493c9d03 100644
--- a/src/nvim/arglist.c
+++ b/src/nvim/arglist.c
@@ -623,6 +623,8 @@ void ex_argument(exarg_T *eap)
/// Edit file "argn" of the argument lists.
void do_argfile(exarg_T *eap, int argn)
{
+ bool is_split_cmd = *eap->cmd == 's';
+
int old_arg_idx = curwin->w_arg_idx;
if (argn < 0 || argn >= ARGCOUNT) {
@@ -637,10 +639,16 @@ void do_argfile(exarg_T *eap, int argn)
return;
}
+ if (!is_split_cmd
+ && (&ARGLIST[argn])->ae_fnum != curbuf->b_fnum
+ && !check_can_set_curbuf_forceit(eap->forceit)) {
+ return;
+ }
+
setpcmark();
// split window or create new tab page first
- if (*eap->cmd == 's' || cmdmod.cmod_tab != 0) {
+ if (is_split_cmd || cmdmod.cmod_tab != 0) {
if (win_split(0, 0) == FAIL) {
return;
}