From e8d91b43ceb93e61f8080485f356f5642e1a9c85 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sun, 24 Oct 2021 16:58:04 +0800 Subject: [PATCH] show redir output in scratch buffer --- autoload/utils.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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.