aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-12-30 22:33:39 +0800
committerjdhao <jdhao@hotmail.com>2021-12-30 22:33:39 +0800
commit0ed8814aef6b21a089cfd8eb31e0e29412ce3972 (patch)
tree4a4e4cc41e05c32e3a57074bc05f3b3481c7dfec /autoload
parenta86f1d2f31bb0e89d4488a9361538cc59776475c (diff)
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.
Diffstat (limited to 'autoload')
-rw-r--r--autoload/utils.vim3
1 files changed, 2 insertions, 1 deletions
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.