vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 0c0bf518cd67f3d2173ac2be26686a5b4d23ca26
parent e678093a157261c611b5d412cbdd6ffcff2f06f3
Author: Florian Fischer <florian.fischer@muhq.space>
Date:   Mon, 25 Mar 2024 18:46:50 +0100

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:
Mlua/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 @@ -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