]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0948: Missing cmdline completion for :pbuffer v9.1.0948
authorzeertzjq <zeertzjq@outlook.com>
Thu, 19 Dec 2024 19:05:28 +0000 (20:05 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 19 Dec 2024 19:05:28 +0000 (20:05 +0100)
Problem:  Missing cmdline completion for :pbuffer.
Solution: Add cmdline completion for :pbuffer like :buffer.
          (zeertzjq)

fixes: #16250
closes: #16251

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/cmdexpand.c
src/testdir/test_preview.vim
src/version.c

index 7e5311481b8684f9776f66492dda5557be509765..3ceb6c73e7c40439d1ea0226297136d1fb7a3977 100644 (file)
@@ -2332,6 +2332,7 @@ set_context_by_cmdname(
            // FALLTHROUGH
        case CMD_buffer:
        case CMD_sbuffer:
+       case CMD_pbuffer:
        case CMD_checktime:
            xp->xp_context = EXPAND_BUFFERS;
            xp->xp_pattern = arg;
index 0df1a90222d1650d7466f2f03fe45e9cdcb704c5..7c7883ace06b3fa0c4866ec78ddd154d07866ab6 100644 (file)
@@ -47,12 +47,23 @@ func Test_window_preview_from_pbuffer()
   edit Xpreview.c
   const buf_num = bufnr('%')
   enew
+
+  call feedkeys(":pbuffer Xpre\<C-A>\<C-B>\"\<CR>", 'xt')
+  call assert_equal("\"pbuffer Xpreview.c", @:)
+
   call assert_equal(1, winnr('$'))
   exe 'pbuffer ' .  buf_num
   call assert_equal(2, winnr('$'))
   call assert_equal(0, &previewwindow)
 
   call s:goto_preview_and_close()
+
+  call assert_equal(1, winnr('$'))
+  pbuffer Xpreview.c
+  call assert_equal(2, winnr('$'))
+  call assert_equal(0, &previewwindow)
+
+  call s:goto_preview_and_close()
 endfunc
 
 func Test_window_preview_terminal()
index f02661753427fba78cac05594d7a8122b9e0d14f..00088ff273e7136d59e0768da53dae45df7fc0d3 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    948,
 /**/
     947,
 /**/