Closed Lautron closed 7 months ago
Fixed this error by adding type = "popup"
to grammar_correction
table.
But now I'm getting this error:
Error detected while processing command line:
Error executing Lua callback: ...nvim/site/pack/packer/start/ogpt.nvim/lua/ogpt/utils.lua:292: attempt to call method 'gsub' (a nil value)
stack traceback:
...nvim/site/pack/packer/start/ogpt.nvim/lua/ogpt/utils.lua:292: in function 'escape_pattern'
...k/packer/start/ogpt.nvim/lua/ogpt/flows/actions/base.lua:162: in function 'render_template'
...k/packer/start/ogpt.nvim/lua/ogpt/flows/actions/base.lua:180: in function 'get_params'
...er/start/ogpt.nvim/lua/ogpt/flows/actions/popup/init.lua:53: in function 'run'
...k/packer/start/ogpt.nvim/lua/ogpt/flows/actions/init.lua:82: in function 'run_action'
...vim/site/pack/packer/start/ogpt.nvim/lua/ogpt/module.lua:87: in function 'run_action'
...share/nvim/site/pack/packer/start/ogpt.nvim/lua/ogpt.lua:113: in function 'run_action'
...re/nvim/site/pack/packer/start/ogpt.nvim/plugin/ogpt.lua:16: in function <...re/nvim/site/pack/packer/start/ogpt.nvim/plugin/ogpt.lua:15>
It seems to work if I use the following configs:
require('ogpt').setup({
default_provider = "gemini",
actions = {
grammar_correction = {
type = "edit",
template = "Correct this to standard:\n\n{{input}}",
},
}
})
require('ogpt').setup({
default_provider = "gemini",
actions = {
grammar_correction = {
type = "popup",
strategy = "display",
template = "Correct this to standard:\n\n{{input}}",
},
}
})
There's definitely a lot more documentation that can be added, I'm going to add some wiki articles to help with some of these configurations! Glad to see you got it figured out
My setup
I'm using packer.nvim
Configuration
packer.lua
nvim/after/plugin/ogpt.lua
The main issue
The command I'm using
:OGPTRun grammar_correction
The error I get