vim-patch:9.1.0192: drop: don't rewind when editing the same file

Problem:  :drop tries to :rewind the argumentlist, which results in E37
          (after v9.1.0046)
Solution: instead of calling ex_rewind(), call open_buffer() only when
          re-using the initial empty buffer

fixes: vim/vim#14219
closes: vim/vim#14220

978178823b

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-03-21 07:34:43 +08:00
parent 774455dc37
commit 271879dd49
3 changed files with 37 additions and 3 deletions

View File

@@ -870,7 +870,9 @@ void ex_drop(exarg_T *eap)
buf_check_timestamp(curbuf);
curbuf->b_p_ar = save_ar;
}
ex_rewind(eap);
if (buf->b_ml.ml_flags & ML_EMPTY) {
open_buffer(false, eap, 0);
}
return;
}
}