aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/lua/gpt.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/plugins/lua/gpt.lua b/src/plugins/lua/gpt.lua
index ca39794c5..79f8882ce 100644
--- a/src/plugins/lua/gpt.lua
+++ b/src/plugins/lua/gpt.lua
@@ -138,11 +138,7 @@ local function default_condition(task)
local words = sel_part:get_words('norm')
nwords = #words
if nwords > settings.max_tokens then
- -- Trim something that does not fit
- for i = nwords, settings.max_tokens, -1 do
- rawset(words, i, nil)
- end
- return true, table.concat(words, ' ')
+ return true, table.concat(words, ' ', 1, settings.max_tokens)
end
end
return true, sel_part:get_content_oneline()