summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-30 22:16:10 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-30 22:16:10 +0200
commit5b8cfedfbd19a71a30c73cf44b0aec3da7fc1a24 (patch)
treefdaa4dec72d804fdbaab665d550dc10b3be0dafb /src/buffer.c
parent892ae723ab95e429222e930cf41b32809567e58e (diff)
downloadvim-git-5b8cfedfbd19a71a30c73cf44b0aec3da7fc1a24.tar.gz
patch 8.1.1612: cannot show an existing buffer in a popup windowv8.1.1612
Problem: Cannot show an existing buffer in a popup window. Solution: Support buffer number argument in popup_create().
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ee68bc955..74e0ea6d0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -122,6 +122,23 @@ read_buffer(
}
/*
+ * 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.
* Return FAIL for failure, OK otherwise.