Skip to content

Commit

Permalink
viki/GetFiles(): Fix iv_include/iv_exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtom committed Sep 29, 2015
1 parent e2089ee commit 8e32e10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 5 additions & 4 deletions autoload/vikitasks.vim
@@ -1,7 +1,7 @@
" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Revision: 2022
" @Revision: 2032

scriptencoding utf-8

Expand Down Expand Up @@ -332,16 +332,16 @@ function! s:GetTasks(args, use_cached) "{{{3
return
endif
let files = get(a:args, 'files', [])
" TLogVAR files
" TLogVAR 1, files
if empty(files)
let [files, file_defs] = s:CollectTaskFiles(0)
" TLogVAR filter(copy(files), 'v:val =~ ''\<Academia.txt$''')
" TLogVAR files
" TLogVAR 2, files
else
let file_defs = {}
endif
" TAssertType files, 'list'
" TLogVAR files
" TLogVAR 3, files
call map(files, 'glob(v:val)')
let files = split(join(files, "\n"), '\n')
let cfiles = map(files, 's:CanonicFilename(v:val)')
Expand Down Expand Up @@ -617,6 +617,7 @@ function! s:FilterTasks(tasks, args) "{{{3

if g:vikitasks#remove_unreadable_files
let filenames = {}
" TLogVAR filter(copy(a:tasks), '!has_key(v:val, "filename")')
call filter(a:tasks, 's:FileReadable(v:val.filename, filenames)')
endif

Expand Down
10 changes: 4 additions & 6 deletions autoload/vikitasks/ft/viki.vim
@@ -1,6 +1,6 @@
" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Revision: 108
" @Revision: 116


" If non-null, automatically add the homepages of your intervikis to
Expand Down Expand Up @@ -80,19 +80,17 @@ function! s:prototype.GetFiles(registrar) dict "{{{3
if scan_interviki > 0
let iv_exclude = tlib#var#Get('vikitasks#ft#viki#intervikis_exclude', 'bg', [])
let iv_include = tlib#var#Get('vikitasks#ft#viki#intervikis_include', 'bg', [])
" TLogVAR iv_exclude
" TLogVAR iv_exclude, iv_include
let ivikis = viki#GetInterVikis()
let nvikis = len(ivikis)
call tlib#progressbar#Init(nvikis, 'VikiTasks: Scan viki %s', 20)
try
let i = 0
for iv in ivikis
" TLogVAR iv
let i += 1
let iv_name = matchstr(iv, '^\u\+')
if index(iv_exclude, iv_name) == -1
\ && (empty(iv_include) || index(iv_include, iv_name) != -1)
" TLogVAR iv
" TLogVAR iv, iv_name
if !empty(iv_include) ? index(iv_include, iv_name) != -1 : index(iv_exclude, iv_name) == -1
call tlib#progressbar#Display(i, ' '. iv)
let def = viki#GetLink(1, '[['. iv .']]', 0, '')
" TLogVAR def
Expand Down

0 comments on commit 8e32e10

Please sign in to comment.