Commits

Takeshi NISHIDA  committed 8fca385

Fixed a bug that unloaded buffers weren't covered by FufBufferTagAll.

  • Participants
  • Parent commits 2415eba

Comments (0)

Files changed (3)

File autoload/fuf.vim

 endfunction
 
 "
-function fuf#countModifiedBuffers(buffers, time)
-  return len(filter(copy(a:buffers), 'getftime(expand(bufname(v:val))) > a:time'))
-endfunction
-
-"
 function fuf#getCurrentTagFiles()
   return sort(filter(map(tagfiles(), 'fnamemodify(v:val, '':p'')'), 'filereadable(v:val)'))
 endfunction
 "=============================================================================
 " LOCAL FUNCTIONS/VARIABLES {{{1
 
-let s:TEMP_VARIABLES_GROUP = "FuzzyFinder"
+let s:TEMP_VARIABLES_GROUP = expand('<sfile>:p')
 let s:ABBR_SNIP_MASK = '...'
 let s:OPEN_TYPE_CURRENT = 1
 let s:OPEN_TYPE_SPLIT   = 2

File autoload/fuf/buffertag.vim

 endfunction
 
 "
+let s:TEMP_VARIABLES_GROUP = expand('<sfile>:p')
+
+"
+function s:getFileType(bufNr)
+  let ft = getbufvar(a:bufNr, '&filetype')
+  if !empty(ft) || bufloaded(a:bufNr)
+    return ft
+  endif
+  let ft = getbufvar(a:bufNr, 'fuf_buffertag_filetype')
+  if !empty(ft)
+    return ft
+  endif
+  call l9#tempvariables#set(s:TEMP_VARIABLES_GROUP, '&eventignore', 'FileType')
+  call l9#tempvariables#set(s:TEMP_VARIABLES_GROUP, '&filetype', &filetype)
+  " from taglist.vim
+  execute 'doautocmd filetypedetect BufRead ' . bufname(a:bufNr)
+  let ft = &filetype
+  call l9#tempvariables#end(s:TEMP_VARIABLES_GROUP)
+  call setbufvar(a:bufNr, 'fuf_buffertag_filetype', ft)
+  return ft
+endfunction
+
+"
 function s:makeCtagsCmd(bufNr)
-  let ft = getbufvar(a:bufNr, "&filetype")
+  let ft = s:getFileType(a:bufNr)
   if !exists('g:fuf_buffertag__{ft}')
     return ''
   endif
 "
 function s:getTagData(bufNrs)
   let key = join([0] + sort(copy(a:bufNrs)), "\n")
+  let bufNames = map(copy(a:bufNrs), 'bufname(v:val)')
   if !exists('s:tagDataCache[key]') ||
-        \ fuf#countModifiedBuffers(a:bufNrs, s:tagDataCache[key].time) > 0
+        \ fuf#countModifiedFiles(bufNames, s:tagDataCache[key].time) > 0
     let itemMap = {}
     for item in l9#concat(map(copy(a:bufNrs), 's:getTagItems(v:val)'))
       if !exists('itemMap[item.tag]')
 ==============================================================================
 CHANGELOG                                                      *fuf-changelog*
 
+4.2.2:
+  - Fixed a bug that unloaded buffers weren't covered by FufBufferTagAll.
+
 4.2.1:
   - Improved response of Buffer-Tag mode.
   - Fixed a bug that buffers which had been opened weren't listed in