Closed MariaSolOs closed 1 year ago
Don't worry about using issues for asking questions, as far as I'm concerned that's what they're for :D
Is there some way to explicitly turn auto_trigger on/off? If so, you could just check expand_or_locally_jumpable
on CursorMoved (or some other common event)
Thanks a lot <3 I ended up using this:
local set_trigger = function(trigger)
vim.b.copilot_suggestion_auto_trigger = trigger
vim.b.copilot_suggestion_hidden = not trigger
end
vim.api.nvim_create_autocmd('User', {
pattern = { 'LuasnipInsertNodeEnter', 'LuasnipInsertNodeLeave' },
callback = function()
set_trigger(not luasnip.expand_or_locally_jumpable())
end,
})
I didn't want to use another event like CursorMovedI
since that's triggered so often and I was afraid I might end up with a weird race condition. So far this seems to work as expected :)
I'm closing this for now since I don't think there's anything here to fix, but thank you @L3MON4D3!
You're welcome :D
This isn't a bug per se, I would just appreciate your help here 🙏🏻
So I'm trying out to figure out the way to disable copilot when I'm inside a snippet (since I use
<tab>
to both navigate inside a snippet and accept a copilot suggestion). I've tried the code below, but this doesn't fully work since I want to disable copilot when I'm navigating anywhere inside the snippet (mainly, whenexpand_or_locally_jumpable()
is true), and reenable it afterwards.I would really appreciate it if you could guide me in finding a better event to achieve this :)