aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-25 10:50:51 +0800
committerGitHub <noreply@github.com>2023-11-25 10:50:51 +0800
commitee276f8758aea38205e04d839afc69e8537a2642 (patch)
tree1836be94b2fa9a37fe879a1ce19ed94f320a7a1e /src/nvim/eval/buffer.c
parent6a2a37b1e102394d99b4891dc9807868f0fa3c97 (diff)
downloadrneovim-ee276f8758aea38205e04d839afc69e8537a2642.tar.gz
rneovim-ee276f8758aea38205e04d839afc69e8537a2642.tar.bz2
rneovim-ee276f8758aea38205e04d839afc69e8537a2642.zip
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 <Bram@vim.org>
Diffstat (limited to 'src/nvim/eval/buffer.c')
-rw-r--r--src/nvim/eval/buffer.c4
1 files changed, 3 insertions, 1 deletions
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);
}
}