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)

188639d75c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-11-25 10:50:51 +08:00
committed by GitHub
parent 6a2a37b1e1
commit ee276f8758
4 changed files with 77 additions and 61 deletions

View File

@@ -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);
}
}