nvim-config

Log | Files | Refs | Submodules | README

commit 225ff9758296abc229416f2d14fdb7ebb5131fdc
parent ccf2282f48e60bb2d57f0f4d99c64d954c1e85b1
Author: Thomas Vigouroux <tomvig38@gmail.com>
Date:   Thu,  9 Dec 2021 17:42:11 +0100

Update complementree config to newest version

Diffstat:
Mlua/completree-config.lua | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lua/completree-config.lua b/lua/completree-config.lua @@ -1,5 +1,8 @@ local comp = require"complementree" local s = require"complementree.sources" +local cc = require"complementree.combinators" +local ccomp = require'complementree.comparators' +local cf = require'complementree.filters' local api = vim.api local function zest_complete(_, _, preffix, _) @@ -27,15 +30,15 @@ end local function md_complete(...) local fullpath = vim.fn.expand "%:p" - if #(vim.fn.system{ 'zest', 'search', string.format('file:%s', fullpath)}) ~= 0 then - s.wrap(zest_complete)(...) + if vim.fn.executable'zest' == 1 and #(vim.fn.system{ 'zest', 'search', string.format('file:%s', fullpath)}) ~= 0 then + cc.wrap(zest_complete)(...) else s.ins_completion("C-F")(...) end end local lsp_completion = { - default = s.preffix_guard(s.combine(s.luasnip_matches, s.lsp_matches)), + default = cc.wrap { matches = cc.combine(s.luasnip_matches, s.lsp_matches), comparator = ccomp.fzy, filter = cf.amount(6) }, string = s.ins_completion "C-F", comment = s.luasnip, }