From da94f1bd45afbf2377fcc4dfc9a9a10b9ed9fdfe Mon Sep 17 00:00:00 2001 From: RN Date: Thu, 21 Jun 2012 15:52:29 -0700 Subject: [PATCH] Use substring instead of prefix based matching to select blog post. Since jekyll uses file names starting with date/time, its hard to traverse through posts when they all start with the same YEAR. This also seems to be more standard like :bufferlist. --- plugin/jekyll.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/jekyll.vim b/plugin/jekyll.vim index dd6fe62..9102184 100644 --- a/plugin/jekyll.vim +++ b/plugin/jekyll.vim @@ -110,7 +110,9 @@ function! s:post_list(A, L, P) let data = s:gsub(glob(prefix.'*.*')."\n", prefix, '') let data = s:gsub(data, '\'.g:jekyll_post_extension."\n", "\n") let files = reverse(split(data, "\n")) - let filtered = filter(copy(files), 's:startswith(v:val, a:A)') + " select the completion candidates using a substring match on the first argument + " instead of a prefix match (I consider this to be more user friendly) + let filtered = filter(copy(files), 'v:val =~ a:A') if ! empty(filtered) return filtered