From c8e33adba00fd0b2b1e1bdddbf24671a78bd0486 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Tue, 5 Aug 2025 17:22:33 +0300 Subject: [PATCH] update blink-cmp to 1.6, fix snippets jumps --- lua/crentist/lazy/completion.lua | 42 ++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/lua/crentist/lazy/completion.lua b/lua/crentist/lazy/completion.lua index a9bd8c9..37af19e 100644 --- a/lua/crentist/lazy/completion.lua +++ b/lua/crentist/lazy/completion.lua @@ -7,13 +7,25 @@ return { { 'L3MON4D3/LuaSnip', version = 'v2.*' } }, -- use a release tag to download pre-built binaries - version = 'v1.4.*', + version = 'v1.6.*', + ---@module 'blink-cmp' + ---@type blink.cmp.Config opts = { fuzzy = { implementation = 'prefer_rust_with_warning' }, snippets = { preset = 'luasnip', + active = function(filter) + local snippet = require('luasnip') + local blink = require('blink.cmp') + if snippet.in_snippet() and not blink.is_visible() then + return true + else + if not snippet.in_snippet() and vim.fn.mode() == 'n' then snippet.unlink_current() end + return false + end + end }, cmdline = { @@ -46,25 +58,25 @@ return { ripgrep = { module = 'blink-ripgrep', name = 'Ripgrep', - score_offset = -2, + score_offset = -5, -- the options below are optional, some default values are shown ---@module 'blink-ripgrep' ---@type blink-ripgrep.Options opts = { - max_filesize = '1M', - project_root_marker = '.git', - project_root_fallback = true, - search_casing = '--ignore-case', - additional_rg_options = {}, - fallback_to_regex_highlighting = true, - ignore_paths = {}, - additional_paths = {}, - future_features = { - backend = { - use = 'ripgrep', - }, + backend = { + use = 'ripgrep', }, - debug = false, + ripgrep = { + ignore_paths = {}, + additional_paths = {}, + additional_rg_options = {}, + max_filesize = '1M', + project_root_fallback = true, + search_casing = '--ignore-case', + }, + project_root_marker = '.git', + fallback_to_regex_highlighting = true, + toggles = { debug = nil, }, }, transform_items = function(_, items) for _, item in ipairs(items) do