You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a custom source that among other things does path completions. The problem I'm having is that if I type something like ~ or ~/, the completion item on Windows could be a normalized path like C:\Users\sid6581. When I accept the completion, I'm left with ~/C:\Users\sid6581. instead of replacing the ~/ entirely and getting C:\Users\sid6581.
I tried setting the keyword pattern to \k\+\|\~/ or even \S\+ and various other variations, thinking that nvim-cmp would see the ~/ as a keyword and replace the whole thing, but that doesn't seem to be the case. Am I missing something obvious, or do I have to do something like manually figure out which characters at the end of cursor_before_line to replace and adding a textEdit with that range?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm writing a custom source that among other things does path completions. The problem I'm having is that if I type something like
~
or~/
, the completion item on Windows could be a normalized path likeC:\Users\sid6581
. When I accept the completion, I'm left with~/C:\Users\sid6581
. instead of replacing the~/
entirely and gettingC:\Users\sid6581
.I tried setting the keyword pattern to
\k\+\|\~/
or even\S\+
and various other variations, thinking that nvim-cmp would see the~/
as a keyword and replace the whole thing, but that doesn't seem to be the case. Am I missing something obvious, or do I have to do something like manually figure out which characters at the end ofcursor_before_line
to replace and adding atextEdit
with that range?Beta Was this translation helpful? Give feedback.
All reactions