Replies: 3 comments 3 replies
-
My question is, if effectively those options needs to be set in order to feed the desired keys effectively, can they be set programmatically rather than by feeding characters to nvim (e.g. |
Beta Was this translation helpful? Give feedback.
-
I keep getting |
Beta Was this translation helpful? Give feedback.
-
I think the situation where nostop is not restored because an error is raised before it can do so can be ruled out because the error would appear in messages, and nvim_feedkeys() seems to batch keystrokes before actually executing them so if there was an error in the nvim-cmp feedkeys cmp (for example invalid input) that it's likely to fail before the backspace option can be set. Could there be a race condition where two instances of feedkeys are run concurrently and the 2nd catches the value of backspace to be nostop and then restores that value at the end of execution after the 1st one already restored the original one? Seems far fetched, but you never know. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/utils/feedkeys.lua#L17 uses nvim feedkeys to set the
backspace=nostop
option temporarily. That option is global, sosetlocal
has the same effect ofset
. In addition to that, using feedkeys to set it makes it hard to understand it was set from a script (e.g. with:verbose set bs?
). I have a problem where sometimesbackspace
gets set tonostop
, and while I'm not sure it's nvim-cmp doing that and failing to restore the previous value after, it's hard to understand what's effectively setting that and why.Beta Was this translation helpful? Give feedback.
All reactions