diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lvim/core/cmp.lua | 37 | 
1 files changed, 25 insertions, 12 deletions
| diff --git a/lua/lvim/core/cmp.lua b/lua/lvim/core/cmp.lua index 5163b877..42ba7003 100644 --- a/lua/lvim/core/cmp.lua +++ b/lua/lvim/core/cmp.lua @@ -334,6 +334,23 @@ M.config = function()          fallback() -- if not exited early, always fallback        end),      }, +    cmdline = { +      enable = true, +      options = { +        { +          type = ":", +          sources = { +            { name = "path" }, +          }, +        }, +        { +          type = { "/", "?" }, +          sources = { +            { name = "buffer" }, +          }, +        }, +      }, +    },    }  end @@ -341,18 +358,14 @@ function M.setup()    local cmp = require "cmp"    cmp.setup(lvim.builtin.cmp) -  cmp.setup.cmdline(":", { -    mapping = cmp.mapping.preset.cmdline(), -    sources = { -      { name = "path" }, -    }, -  }) -  cmp.setup.cmdline({ "/", "?" }, { -    mapping = cmp.mapping.preset.cmdline(), -    sources = { -      { name = "buffer" }, -    }, -  }) +  if lvim.builtin.cmp.cmdline.enable then +    for _, option in ipairs(lvim.builtin.cmp.cmdline.options) do +      cmp.setup.cmdline(option.type, { +        mapping = cmp.mapping.preset.cmdline(), +        sources = option.sources, +      }) +    end +  end  end  return M | 
