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

3baf19a2b1
This commit is contained in:
zeertzjq
2024-12-20 08:04:46 +08:00
committed by GitHub
parent 8ef41f5902
commit 889f9a0c5d
2 changed files with 12 additions and 0 deletions

View File

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

View 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()