From 30b63f71bd48a8e28193c7f76afc985c2107f955 Mon Sep 17 00:00:00 2001 From: chaihahaha Date: Tue, 8 Aug 2023 00:08:49 +0800 Subject: [PATCH] multiline autocompletion, get rid of "^@" --- examples/llm.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/llm.vim b/examples/llm.vim index efecad0cd..bfcff5362 100644 --- a/examples/llm.vim +++ b/examples/llm.vim @@ -16,8 +16,10 @@ function! Llm() " Extract the content field from the response let content = json_decode(response).content + let split_newlines = split(content, '\n', 1) + " Insert the content at the cursor position - call setline(line('.'), getline('.') . content) + call setline(line('.'), [ getline('.') . split_newlines[0] ] + split_newlines[1:]) endfunction command! Llm call Llm()