From 74c94ea886b7648e9ae19f0a538d1a284e211a1d Mon Sep 17 00:00:00 2001 From: Sergio Alejandro Vargas Date: Sun, 18 Jul 2021 14:28:08 -0500 Subject: [PATCH] Allow funcrefs in `wiki_map_link_create` Funcrefs must start with a capital letter, so this only really works with Lua functions in Neovim. --- autoload/wiki/link/word.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/wiki/link/word.vim b/autoload/wiki/link/word.vim index 0f6e41cf..bf6d78fc 100644 --- a/autoload/wiki/link/word.vim +++ b/autoload/wiki/link/word.vim @@ -25,7 +25,7 @@ function! s:matcher.toggle_template(words, _text) abort " {{{1 " asks for target link. " Allow map from word -> url (without extension) - if !empty(g:wiki_map_link_create) && exists('*' . g:wiki_map_link_create) + if !empty(g:wiki_map_link_create) && (type(g:wiki_map_link_create) == 2 || exists('*' . g:wiki_map_link_create)) let l:url_target = call(g:wiki_map_link_create, [a:words]) else let l:url_target = a:words