瀏覽代碼

fix: copilot indent reset (#3343) (#3960)

Khilseith 2 年之前
父節點
當前提交
57395bcc8a
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      lua/lvim/core/cmp.lua

+ 6 - 0
lua/lvim/core/cmp.lua

@@ -331,6 +331,12 @@ M.config = function()
           if is_insert_mode() then -- prevent overwriting brackets
             confirm_opts.behavior = ConfirmBehavior.Insert
           end
+          local entry = cmp.get_selected_entry()
+          local is_copilot = entry and entry.source.name == "copilot"
+          if is_copilot then
+            confirm_opts.behavior = ConfirmBehavior.Replace
+            confirm_opts.select = true
+          end
           if cmp.confirm(confirm_opts) then
             return -- success, exit early
           end