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