Closed james-ennis closed 1 year ago
The copilot-enable-predicates
contains two functions by default. Can you please confirm which one is causing the plugin to not work with Spacemacs?
I tried setting it to both copilot--buffer-changed
and evil-insert-state-p
individually, neither worked.
These were the two functions I found when I did M-x describe-varable copilot-enable-predicates
(setq copilot-enable-predicates '(evil-insert-state-p))
(setq copilot-enable-predicates '(copilot--buffer-changed))
In case you forgot to make it a list.
It's strange if both of them are preventing the plugin from working.
Ah yes, I didn't make them a list. Thanks, so it's:
(setq copilot-enable-predicates '(evil-insert-state-p))
that is preventing the plugin from working. I wonder if this is because I use spacemacs with emacs keybindings rather than vim ones. That setting sounds very vim-like
Yes, evil-insert-state-p
will prevent the plugin from triggering completions if the current VIM state is not insert
. However, copilot.el
will ignore this function if it's not available, so it should work for users using Emacs keybindings.
I'm curious why (functionp evil-insert-state-p)
returns t
, even when you're using Emacs keybindings.
I'm not actually able to see functionp
when I run M-x
, not to sure why. I can describe it though:
evil-insert-state-p is a native-compiled Lisp function in ‘hybrid-mode.el’.
(evil-insert-state-p &optional STATE)
Whether the current state is insert.
So what shall we do with this PR? It sounds to me as though you're suggesting it could be an issue with Spacemacs?
Spacemacs offers three editing styles: Vim, Emacs, and Hybrid. However, hybrid-mode
is beyond the scope of consideration due to the small number of users.
I recommend that you switch your editing style from hybrid to emacs, or alternatively customize copilot-enable-predicates
.
In order for this plugin to work with spacemacs we need to set
copilot-enable-predicates
tonil
. This closes #123