diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-12-20 08:04:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-20 08:04:46 +0800 |
commit | 889f9a0c5d1f3fe522af0d2b43a82317b0589b94 (patch) | |
tree | cfc450fa326baa1fa528a0c56fac4ef17b25581f | |
parent | 8ef41f590224dfeea2e51d9fec150e363fd72ee0 (diff) | |
download | rneovim-889f9a0c5d1f3fe522af0d2b43a82317b0589b94.tar.gz rneovim-889f9a0c5d1f3fe522af0d2b43a82317b0589b94.tar.bz2 rneovim-889f9a0c5d1f3fe522af0d2b43a82317b0589b94.zip |
vim-patch:9.1.0948: Missing cmdline completion for :pbuffer (#31645)
Problem: Missing cmdline completion for :pbuffer.
Solution: Add cmdline completion for :pbuffer like :buffer.
(zeertzjq)
fixes: vim/vim#16250
closes: vim/vim#16251
https://github.com/vim/vim/commit/3baf19a2b144b215c5b537c3c1b3b80a79b0fe99
-rw-r--r-- | src/nvim/cmdexpand.c | 1 | ||||
-rw-r--r-- | test/old/testdir/test_preview.vim | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index d977b20cc4..80ff5e057d 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -2001,6 +2001,7 @@ static const char *set_context_by_cmdname(const char *cmd, cmdidx_T cmdidx, expa FALLTHROUGH; case CMD_buffer: case CMD_sbuffer: + case CMD_pbuffer: case CMD_checktime: xp->xp_context = EXPAND_BUFFERS; xp->xp_pattern = (char *)arg; diff --git a/test/old/testdir/test_preview.vim b/test/old/testdir/test_preview.vim index 424d93f54d..422c50ac77 100644 --- a/test/old/testdir/test_preview.vim +++ b/test/old/testdir/test_preview.vim @@ -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() |