aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-03-25 18:46:50 +0100
committerRandy Palamar <randy@rnpnr.xyz>2024-04-30 19:54:55 -0600
commit4d5bfb807bee2d914587b50d1fe17c994bcbffab (patch)
tree2becaeaf2f9ddc7b3ee90baf1dc602efa4cfefdf /lua
parent675ab49ed928e4ae63363f77007ec6c99e91a51a (diff)
downloadvis-4d5bfb807bee2d914587b50d1fe17c994bcbffab.tar.gz
vis-4d5bfb807bee2d914587b50d1fe17c994bcbffab.tar.xz
lua: complete-filename: use biggest possible prefix
This allows for example to complete file names in markdown images. E.g.: ![](pic<C-x><C-f> will complete the file name. Previously it would have detected the '[' as prefix.
Diffstat (limited to 'lua')
-rw-r--r--lua/plugins/complete-filename.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/plugins/complete-filename.lua b/lua/plugins/complete-filename.lua
index 70431b6..43cf14b 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