Can't get ChatGPTEditWithInstructions to work with text selected in visual mode
Vim says 'no range allowed' but it will run with no text selected and run on the last text you selected, but only once you have deselected it.
How are you managing to get it to work in the video? Could you post your keybinding from your lua file for me to test with?
I'm guessing he has a custom keybinding to get it working.
Using which-key the following works:
local chatgpt = require("chatgpt")
wk.register({
p = {
name = "ChatGPT",
e = {
function()
chatgpt.edit_with_instructions()
end,
"Edit with instructions",
},
},
}, {
prefix = "<leader>",
mode = "v",
})
Basically just setup a keybind for visual mode that calls the edit_with_instructions function.
The function is smart enough to detect a visual selection or not.
Wonderful, got this working and learned some things about lua in the process (I'm new to it)
@jackMort was there an actual fix for this? I've just tested it with the latest and still having the same issue.
+1, how is this closed? Shouldn't https://github.com/jackMort/ChatGPT.nvim/pull/58 be merged?