aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-12-30 23:39:03 +0800
committerjdhao <jdhao@hotmail.com>2021-12-30 23:39:03 +0800
commite82b450464a7976e72e7282278831b9466a4d291 (patch)
tree5e0aaa13d18fbd4b8dcad23da5ad4a231fd20755
parent08818dbf01821dbd9f3aa8388d1ddf4c3c590fc1 (diff)
split command output to list of string and set the buffer
-rw-r--r--autoload/utils.vim3
1 files changed, 2 insertions, 1 deletions
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.