1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

show redir output in scratch buffer

This commit is contained in:
jdhao 2021-10-24 16:58:04 +08:00
parent ae98924048
commit e8d91b43ce

View File

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