From 4d5bfb807bee2d914587b50d1fe17c994bcbffab Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 25 Mar 2024 18:46:50 +0100 Subject: [PATCH] lua: complete-filename: use biggest possible prefix This allows for example to complete file names in markdown images. E.g.: ![](pic will complete the file name. Previously it would have detected the '[' as prefix. --- lua/plugins/complete-filename.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/complete-filename.lua b/lua/plugins/complete-filename.lua index 70431b670..43cf14b1d 100644 --- a/lua/plugins/complete-filename.lua +++ b/lua/plugins/complete-filename.lua @@ -13,7 +13,7 @@ local complete_filename = function(expand) if not prefix then return end -- Strip leading delimiters for some programming languages - local _, j = prefix:find("[{[(<'\"]+") + local _, j = prefix:find(".*[{[(<'\"]+") if not expand and j then prefix = prefix:sub(j + 1) end if prefix:match("^%s*$") then