From e82b450464a7976e72e7282278831b9466a4d291 Mon Sep 17 00:00:00 2001 From: jdhao Date: Thu, 30 Dec 2021 23:39:03 +0800 Subject: [PATCH] split command output to list of string and set the buffer --- autoload/utils.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/utils.vim b/autoload/utils.vim index 7d6f9bd..c029cd3 100644 --- a/autoload/utils.vim +++ b/autoload/utils.vim @@ -181,7 +181,8 @@ function! utils#CaptureCommandOutput(command) abort "create a scratch buffer for dumping the text, ref: https://vi.stackexchange.com/a/11311/15292. tabnew | setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile - put! m + let l:lines = split(@m, '\n') + call nvim_buf_set_lines(0, 0, 0, 0, l:lines) endfunction " Edit all files matching the given patterns.