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

refactor: capture command output silently

This commit is contained in:
jdhao 2021-12-30 22:33:06 +08:00
parent c1b27ee818
commit a86f1d2f31

View File

@ -175,7 +175,7 @@ endfunction
" Ref: https://stackoverflow.com/q/2573021/6064933 and https://unix.stackexchange.com/q/8101/221410 .
function! utils#CaptureCommandOutput(command) abort
redir @m
execute a:command
silent! execute a:command
redir END
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.