Skip to content

Commit 66fa4f1

Browse files
committed
introduce config variable to prevent Copilot asking questions
1 parent a12fd56 commit 66fa4f1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

autoload/copilot/handlers.vim

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ function! copilot#handlers#window_logMessage(params, ...) abort
33
endfunction
44

55
function! copilot#handlers#window_showMessageRequest(params, instance, ...) abort
6-
let choice = inputlist([a:instance.name . "\n" . a:params.message . "\n\nRequest Actions:"] +
7-
\ map(copy(get(a:params, 'actions', [])), { i, v -> (i + 1) . '. ' . v.title}))
8-
return choice > 0 ? get(a:params.actions, choice - 1, v:null) : v:null
6+
if exists('g:copilot_dontask') && g:copilot_dontask
7+
echomsg a:params.message
8+
return v:null
9+
else
10+
let choice = inputlist([a:instance.name . "\n" . a:params.message . "\n\nRequest Actions:"] +
11+
\ map(copy(get(a:params, 'actions', [])), { i, v -> (i + 1) . '. ' . v.title}))
12+
return choice > 0 ? get(a:params.actions, choice - 1, v:null) : v:null
13+
endif
914
endfunction
1015

1116
function! s:BrowserCallback(into, code) abort

0 commit comments

Comments
 (0)