From 3819974a28ad183c9ccd71cfd1f81c96e7e8c92d Mon Sep 17 00:00:00 2001 From: Jonas Widen <jonas.widen@widens.eu> Date: Sun, 16 Mar 2025 21:38:04 +0100 Subject: [PATCH] Added completion --- lua/gemini/completion.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/gemini/completion.lua b/lua/gemini/completion.lua index 5fe6ba9..b7cfcee 100644 --- a/lua/gemini/completion.lua +++ b/lua/gemini/completion.lua @@ -21,6 +21,10 @@ end local function show_suggestion(suggestion, start_col) clear_suggestion() + -- Only use first line of suggestion + suggestion = suggestion:match("^[^\n]*") + if suggestion == "" then return end + local line = vim.api.nvim_win_get_cursor(0)[1] - 1 current_suggestion.text = suggestion current_suggestion.start_col = start_col