diff options
| author | jdhao <jdhao@hotmail.com> | 2021-10-24 16:58:04 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2021-10-24 17:03:44 +0800 |
| commit | e8d91b43ceb93e61f8080485f356f5642e1a9c85 (patch) | |
| tree | 9dff3c48ae61bba5a723da9f1fdac7a61af4503b /autoload/utils.vim | |
| parent | ae9892404826c170353c4c5124fe466b147165d2 (diff) | |
show redir output in scratch buffer
Diffstat (limited to 'autoload/utils.vim')
| -rw-r--r-- | autoload/utils.vim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/autoload/utils.vim b/autoload/utils.vim index 696063d..0231e8b 100644 --- a/autoload/utils.vim +++ b/autoload/utils.vim @@ -182,7 +182,10 @@ function! utils#CaptureCommandOutput(command) abort redir @m execute a:command redir END - call v:lua.vim.notify("command output captured to register m", "info", {'title': 'nvim-config'}) + call v:lua.vim.notify("command output captured to register m", "info", {'title': 'nvim-config'}) + "create a scratch buffer for dumping the text, ref: https://vi.stackexchange.com/a/11311/15292. + tabnew | setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile + call nvim_buf_set_lines(0, 0, 0, 0, [@m]) endfunction " Edit all files matching the given patterns. |
