Make generation functions compatible with older vims.

PR #634, PR #635, and PR #636 introduced new features that broke
compatibility with older version of Vim. This modifies those changes to
ensure compatibility. Closes #781.

Removes usage of funcref(), closure. Fixes filter() call.
Made globpath calls not use the list argument.
Unlet a variable that is reused (sticky type checking)

v7.4.1989 modified filter() to accept a Funcref
v7.4.2120 Added function "closure" argument
v7.4.2137 add funcref()
This commit is contained in:
Rane Brown
2019-12-02 21:59:32 -07:00
parent c8bb658360
commit 460fcb692e
3 changed files with 31 additions and 24 deletions

View File

@ -312,7 +312,8 @@ endfunction
function! vimwiki#diary#generate_diary_section()
function! Generator() closure
let GeneratorDiary = copy(l:)
function! GeneratorDiary.f()
let lines = []
let links_with_captions = s:read_captions(s:get_diary_files())
@ -392,7 +393,7 @@ function! vimwiki#diary#generate_diary_section()
\ '\%(^\s*$\)\|\%('.vimwiki#vars#get_syntaxlocal('rxListBullet').'\)'
call vimwiki#base#update_listing_in_buffer(
\ funcref('Generator'),
\ GeneratorDiary,
\ vimwiki#vars#get_wikilocal('diary_header'),
\ content_rx,
\ 1,