From 1af2be20360c78a9e21c12d3165c75e8d2e734f4 Mon Sep 17 00:00:00 2001 From: Erik Cowley Date: Sat, 18 Nov 2023 12:20:48 -0500 Subject: [PATCH] Fix to LocalAI code for nvim --- init.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 7dbc95a..693cc93 100644 --- a/init.lua +++ b/init.lua @@ -355,9 +355,6 @@ local function get_visual_selection() line_start = line_start - 1 end local line_stop = vim.api.nvim_buf_get_mark(buf, ">")[1] - if line_stop > 1 then - line_stop = line_stop - 1 - end local lines = vim.api.nvim_buf_get_lines(buf, line_start, line_stop, true) local result = "" for _, line in pairs(lines) do @@ -405,7 +402,7 @@ end function localai_review(args) local visual_selection = get_visual_selection() - local prompt = "Please review the following code:\n```\n" .. visual_selection .. "\n```\n" + local prompt = "Please review the following code:\n```\n" .. visual_selection .. "```" call_localai("WizardCoder-15B-1.0.ggmlv3.q4_1.bin", prompt, 0.1) end