0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.1612: cannot show an existing buffer in a popup window

Problem:    Cannot show an existing buffer in a popup window.
Solution:   Support buffer number argument in popup_create().
This commit is contained in:
Bram Moolenaar
2019-06-30 22:16:10 +02:00
parent 892ae723ab
commit 5b8cfedfbd
12 changed files with 143 additions and 79 deletions

View File

@@ -121,6 +121,23 @@ read_buffer(
return retval;
}
/*
* Ensure buffer "buf" is loaded. Does not trigger the swap-exists action.
*/
void
buffer_ensure_loaded(buf_T *buf)
{
if (buf->b_ml.ml_mfp == NULL)
{
aco_save_T aco;
aucmd_prepbuf(&aco, buf);
swap_exists_action = SEA_NONE;
open_buffer(FALSE, NULL, 0);
aucmd_restbuf(&aco);
}
}
/*
* Open current buffer, that is: open the memfile and read the file into
* memory.