David-Kunz / gen.nvim

Neovim plugin to generate text using LLMs with customizable prompts
The Unlicense
1.15k stars 92 forks source link

error in readme #2

Closed JoseConseco closed 1 year ago

JoseConseco commented 1 year ago

Following code from readme:

table.insert(require('gen').prompts, {
    Elaborate_Text = {
        prompt = "Elaborate the following text:\n$text",
        replace = true
    },
    Fix_Code = {
        prompt = "Fix the following code. Only ouput the result in format ```$filetype\n...\n```:\n```$filetype\n$text\n```",
        replace = true,
        extract = "```$filetype\n(.-)```"
    }
})

Will give wrong structure in prompts table like this: prompts = { old_prompt={}, old_prompt2={}, {inserted_promp1={}, inserted_prompt2={}} Which then gives error when running :Gen. what worked was require('gen').prompts['my custom prompt'] = { ... }

David-Kunz commented 1 year ago

Thank you again, @JoseConseco , it's fixed now!