File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,10 @@ To toggle auto trigger for the current buffer, use `require("copilot.suggestion"
134
134
135
135
Copilot suggestion is automatically hidden when ` popupmenu-completion ` is open. In case you use a custom
136
136
menu for completion, you can set the ` copilot_suggestion_hidden ` buffer variable to ` true ` to have the
137
- same behavior. For example, with ` nvim-cmp ` :
137
+ same behavior.
138
+
139
+ <details >
140
+ <summary >Example using nvim-cmp</summary >
138
141
139
142
``` lua
140
143
cmp .event :on (" menu_opened" , function ()
@@ -145,6 +148,29 @@ cmp.event:on("menu_closed", function()
145
148
vim .b .copilot_suggestion_hidden = false
146
149
end )
147
150
```
151
+ </details >
152
+
153
+ <details >
154
+ <summary >Example using blink.cmp</summary >
155
+
156
+ ``` lua
157
+ vim .api .nvim_create_autocmd (" User" , {
158
+ pattern = " BlinkCmpMenuOpen" ,
159
+ callback = function ()
160
+ vim .b .copilot_suggestion_hidden = true
161
+ end ,
162
+ })
163
+
164
+ vim .api .nvim_create_autocmd (" User" , {
165
+ pattern = " BlinkCmpMenuClose" ,
166
+ callback = function ()
167
+ vim .b .copilot_suggestion_hidden = false
168
+ end ,
169
+ })
170
+
171
+ ```
172
+ </details >
173
+
148
174
149
175
The ` copilot.suggestion ` module exposes the following functions:
150
176
You can’t perform that action at this time.
0 commit comments