From b03e790cddd19b57fa91f4fbfcc30c28f3c173bf Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 17 Dec 2024 11:34:30 +0800 Subject: vim-patch:9.1.0934: hard to view an existing buffer in the preview window (#31605) Problem: hard to view an existing buffer in the preview window Solution: add the :pbuffer command (Yinzuo Jiang) Similar as `:pedit` and `:buffer` command. `:pbuffer` edits buffer [N] from the buffer list in the preview window. `:pbuffer` can also open special buffer, for example terminal buffer. closes: vim/vim#16222 https://github.com/vim/vim/commit/a2a2fe841ed2efdbb1f8055f752a3a4d0988ae9d Cherry-pick Test_popup_and_previewwindow_dump() changes from patch 9.0.0625. Cherry-pick Run_noroom_for_newwindow_test() changes from patches 8.2.0432 and 9.0.0363. Co-authored-by: Yinzuo Jiang --- runtime/doc/index.txt | 1 + runtime/doc/windows.txt | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index d81d59c56f..0182123a12 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1472,6 +1472,7 @@ tag command action ~ |:ownsyntax| :ow[nsyntax] set new local syntax highlight for this window |:packadd| :pa[ckadd] add a plugin from 'packpath' |:packloadall| :packl[oadall] load all packages under 'packpath' +|:pbuffer| :pb[uffer] edit buffer in the preview window |:pclose| :pc[lose] close preview window |:pedit| :ped[it] edit file in the preview window |:perl| :pe[rl] execute perl command diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index a6e5984c82..d3c58a28a4 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -978,6 +978,13 @@ CTRL-W g } *CTRL-W_g}* it. Make the new Preview window (if required) N high. If N is not given, 'previewheight' is used. + *:pb* *:pbuffer* +:[N]pb[uffer][!] [+cmd] [N] + Edit buffer [N] from the buffer list in the preview window. + If [N] is not given, the current buffer remains being edited. + See |:buffer-!| for [!]. This will also edit a buffer that is + not in the buffer list, without setting the 'buflisted' flag. + *:ped* *:pedit* :ped[it][!] [++opt] [+cmd] {file} Edit {file} in the preview window. The preview window is -- cgit