From 00e9a228dcc95ad14aad50437df4f9a79fe1425e Mon Sep 17 00:00:00 2001 From: Austin Mroz Date: Mon, 7 Aug 2023 12:36:17 -0500 Subject: [PATCH] Remove getbufoneline usage, Add input bind example. getbufoneline() appears to be a recently added function and has been replaced with getbufline for compatibility. An additional example that explains how to add a keybind that works in insert mode was added. --- examples/llama.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/llama.vim b/examples/llama.vim index fe51e67be..f03fadfb7 100644 --- a/examples/llama.vim +++ b/examples/llama.vim @@ -3,6 +3,8 @@ " Then start with either :call llama#doLlamaGen(), " or add a keybind to your vimrc such as " nnoremap Z :call llama#doLlamaGen() +" Similarly, you could add an insert mode keybind with +" inoremap call llama#doLlamaGen() " " g:llama_api_url and g:llama_overrides can be configured in your .vimrc " let g:llama_api_url = "192.168.1.10:8080" @@ -41,7 +43,7 @@ func s:callbackHandler(bufn, channel, msg) let l:decoded_msg = json_decode(l:msg) let l:newtext = split(l:decoded_msg['content'], "\n", 1) if len(l:newtext) > 0 - call setbufline(a:bufn, s:linedict[a:bufn], getbufoneline(a:bufn, s:linedict[a:bufn]) .. newtext[0]) + call setbufline(a:bufn, s:linedict[a:bufn], getbufline(a:bufn, s:linedict[a:bufn])[0] .. newtext[0]) else echo "nothing genned" endif