Skip to content

Commit 7ed8d1f

Browse files
authored
llm.vim : multiline autocompletion, get rid of "^@" (#2543)
1 parent e7f94d6 commit 7ed8d1f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/llm.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ function! Llm()
1818
" Extract the content field from the response
1919
let content = json_decode(response).content
2020

21+
let split_newlines = split(content, '\n', 1)
22+
2123
" Insert the content at the cursor position
22-
call setline(line('.'), getline('.') . content)
24+
call setline(line('.'), [ getline('.') . split_newlines[0] ] + split_newlines[1:])
2325
endfunction
2426

2527
command! Llm call Llm()

0 commit comments

Comments
 (0)