Skip to content

Disabling use of Tab to accept copilot suggestion causes Tab to insert the letter "t" #125

Open
@mwagnell

Description

@mwagnell

I found that if I disabled the use of tab to accept copilot suggestions as described in the help information, the Tab key would then insert the letter "t". I fixed that with the change below, but this seems like a basic enough problem that I'm wondering if there might be something more subtle going on.

diff --git i/plugin/copilot.vim w/plugin/copilot.vim
index 4d3d216..41ee457 100644
--- i/plugin/copilot.vim
+++ w/plugin/copilot.vim
@@ -26,7 +26,7 @@ function! s:MapTab() abort
   endif
   let tab_map = maparg('<Tab>', 'i', 0, 1)
   if !has_key(tab_map, 'rhs')
-    imap <script><silent><nowait><expr> <Tab> empty(get(g:, 'copilot_no_tab_map')) ? copilot#Accept() : "\t"
+    imap <script><silent><nowait><expr> <Tab> empty(get(g:, 'copilot_no_tab_map')) ? copilot#Accept() : "<Tab>"
   elseif tab_map.rhs !~# 'copilot'
     if tab_map.expr
       let tab_fallback = '{ -> ' . tab_map.rhs . ' }'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions