From 4d0ec05f9ab0b42770560026a84d552a2841d45c Mon Sep 17 00:00:00 2001 From: geril Date: Wed, 23 Jul 2025 18:49:29 +0300 Subject: [PATCH] fix: wrap vim.fn.complete into pcall when adding to dot repeat --- lua/blink/cmp/lib/text_edits.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/blink/cmp/lib/text_edits.lua b/lua/blink/cmp/lib/text_edits.lua index dbe93d38..a5ec00f2 100644 --- a/lua/blink/cmp/lib/text_edits.lua +++ b/lua/blink/cmp/lib/text_edits.lua @@ -386,7 +386,8 @@ function text_edits.write_to_dot_repeat(text_edit) local saved_shortmess = vim.o.shortmess vim.opt.completeopt = '' if not vim.o.shortmess:match('c') then vim.o.shortmess = vim.o.shortmess .. 'c' end - vim.fn.complete(1, { '_' .. chars_to_insert }) + local success, err = pcall(vim.fn.complete, 1, { '_' .. chars_to_insert }) + if not success then vim.print('dot repeat is not added: ' .. err) end vim.opt.completeopt = saved_completeopt vim.o.shortmess = saved_shortmess