From ee276f8758aea38205e04d839afc69e8537a2642 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 25 Nov 2023 10:50:51 +0800 Subject: vim-patch:8.2.4685: when a swap file is found for a popup there is no dialog (#26207) Problem: When a swap file is found for a popup there is no dialog and the buffer is loaded anyway. Solution: Silently load the buffer read-only. (closes vim/vim#10073) https://github.com/vim/vim/commit/188639d75c363dffaf813e8e2209f7350ad1e871 Co-authored-by: Bram Moolenaar --- src/nvim/eval/buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/buffer.c b/src/nvim/eval/buffer.c index 616c1e06fc..93e4f14980 100644 --- a/src/nvim/eval/buffer.c +++ b/src/nvim/eval/buffer.c @@ -298,7 +298,9 @@ void f_bufload(typval_T *argvars, typval_T *unused, EvalFuncData fptr) buf_T *buf = get_buf_arg(&argvars[0]); if (buf != NULL) { - swap_exists_action = SEA_NONE; + if (swap_exists_action != SEA_READONLY) { + swap_exists_action = SEA_NONE; + } buf_ensure_loaded(buf); } } -- cgit