From 0ed8814aef6b21a089cfd8eb31e0e29412ce3972 Mon Sep 17 00:00:00 2001 From: jdhao Date: Thu, 30 Dec 2021 22:33:39 +0800 Subject: [PATCH] fix: command output captured by a register not formatted properly Newline is converted to NUL character, which is nasty, see also https://vi.stackexchange.com/q/6697/15292. --- autoload/utils.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/utils.vim b/autoload/utils.vim index 5e762f3..7463e74 100644 --- a/autoload/utils.vim +++ b/autoload/utils.vim @@ -180,7 +180,8 @@ function! utils#CaptureCommandOutput(command) abort 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]) + + put! m endfunction " Edit all files matching the given patterns.