X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/4b8f631148d5ed7830cc34a7aa91ef71ea253f84..d12befde9cfc3d83c04c484107f2d0ac5dc40e45:/test/vimrc diff --git a/test/vimrc b/test/vimrc index 86020ed..44df1b6 100644 --- a/test/vimrc +++ b/test/vimrc @@ -6,3 +6,19 @@ filetype on filetype plugin on filetype indent on syntax on + +function! Markdown_GetScriptID(fname) abort + let a:snlist = '' + redir => a:snlist + silent! scriptnames + redir END + let a:mx = '^\s*\(\d\+\):\s*\(.*\)$' + for a:line in split(a:snlist, "\n") + if stridx(a:line, a:fname) >= 0 + return substitute(a:line, a:mx, '\1', '') + endif + endfor +endfunction +function! Markdown_GetFunc(fname, funcname) abort + return function('' . Markdown_GetScriptID(a:fname) . '_' . a:funcname) +endfunction