nvim-config

Log | Files | Refs | Submodules | README

commit 2e0a811590e8e5990efb5ccb66714af6b8301c24
parent 0299d97098b1f0547a0950ba41dcdd64c6e250e6
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Wed, 31 Aug 2022 17:18:25 +0200

feat: revive zest configuration

Diffstat:
Mlua/completree-config.lua | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lua/completree-config.lua b/lua/completree-config.lua @@ -4,13 +4,15 @@ local cdef = require 'complementree.defaults' local cc = require "complementree.combinators" local ccomp = require 'complementree.comparators' local cf = require 'complementree.filters' +local utils = require 'complementree.utils' local api = vim.api -local function zest_complete(_, _, preffix, _) +local function zest_complete(ltc, _) + local preffix = utils.prefix.lua_regex("[a-zA-Z0-9_-./\\]+", ltc) local query if preffix and #preffix ~= 0 then - query = string.format("file:%s", preffix) + query = string.format("*%s*", preffix) else query = "*" end @@ -27,15 +29,13 @@ local function zest_complete(_, _, preffix, _) }) end - return ret + return ret, preffix end local function md_complete(...) local fullpath = vim.fn.expand "%:p" if vim.fn.executable 'zest' == 1 and #(vim.fn.system { 'zest', 'search', string.format('file:%s', fullpath) }) ~= 0 then cc.wrap(zest_complete)(...) - elseif vim.fn.executable "zk" == 1 and vim.startswith(fullpath, vim.fn.expand("$ZK_NOTEBOOK_DIR")) then - cc.pipeline(s.lsp_matches {}, ccomp.debug, ccomp.fzy)(...) else cdef.ins_completion("C-F")(...) end