Commits

Takeshi NISHIDA  committed f7ab6c7

Changed the filename to store data of Coverage-File mode

  • Participants
  • Parent commits 3077515

Comments (0)

Files changed (23)

File autoload/fuf.vim

 function s:createEditDataListener()
   let listener = {}
 
-  function listener.onComplete(modeName, method)
-    let bufName = '[fuf-info-' . a:modeName . ']'
-    let lines = l9#readFile(l9#concatPaths([g:fuf_dataDir, a:modeName, 'items']))
+  function listener.onComplete(dataFile, method)
+    let bufName = '[fuf-info]'
+    let lines = l9#readFile(l9#concatPaths([g:fuf_dataDir, a:dataFile]))
     call l9#tempbuffer#openWritable(bufName, 'vim', lines, 0, 0, 0,
-          \                         s:createDataBufferListener(a:modeName))
+          \                         s:createDataBufferListener(a:dataFile))
   endfunction
 
   return listener
 endfunction
 
 "
+function s:getEditableDataFiles(modeName)
+  let dataFiles = fuf#{a:modeName}#getEditableDataNames()
+  call filter(dataFiles, 'fuf#getDataFileTime(a:modeName, v:val) != -1')
+  return map(dataFiles, 'l9#concatPaths([a:modeName, v:val])')
+endfunction
+
+"
 function fuf#editDataFile()
-  let modes = filter(copy(fuf#getModeNames()), 'fuf#getDataFileTime(v:val, "items") != -1')
-  call fuf#callbackitem#launch('', 0, '>Mode>', s:createEditDataListener(), modes, 0)
+  let dataFiles = map(copy(fuf#getModeNames()), 's:getEditableDataFiles(v:val)')
+  let dataFiles = l9#concat(dataFiles)
+  call fuf#callbackitem#launch('', 0, '>Mode>', s:createEditDataListener(), dataFiles, 0)
 endfunction
 
 " 

File autoload/fuf/aroundmrufile.vim

 endfunction
 
 "
+function fuf#aroundmrufile#getEditableDataNames()
+  return ['items']
+endfunction
+
+"
 function fuf#aroundmrufile#renewCache()
   let s:cache = {}
 endfunction

File autoload/fuf/bookmarkdir.vim

 endfunction
 
 "
+function fuf#bookmarkdir#getEditableDataNames()
+  return ['items']
+endfunction
+
+"
 function fuf#bookmarkdir#renewCache()
 endfunction
 

File autoload/fuf/bookmarkfile.vim

 endfunction
 
 "
+function fuf#bookmarkfile#getEditableDataNames()
+  return ['items']
+endfunction
+
+"
 function fuf#bookmarkfile#renewCache()
 endfunction
 

File autoload/fuf/buffer.vim

 endfunction
 
 "
+function fuf#buffer#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#buffer#renewCache()
 endfunction
 

File autoload/fuf/callbackfile.vim

 endfunction
 
 "
+function fuf#callbackfile#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#callbackfile#renewCache()
   let s:cache = {}
 endfunction

File autoload/fuf/callbackitem.vim

 endfunction
 
 "
+function fuf#callbackitem#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#callbackitem#renewCache()
 endfunction
 

File autoload/fuf/changelist.vim

 endfunction
 
 "
+function fuf#changelist#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#changelist#renewCache()
 endfunction
 

File autoload/fuf/coveragefile.vim

 endfunction
 
 "
+function fuf#coveragefile#getEditableDataNames()
+  return ['coverages']
+endfunction
+
+"
 function fuf#coveragefile#renewCache()
   let s:cache = {}
 endfunction
     call fuf#echoWarning('Canceled')
     return
   endif
-  let coverages = fuf#loadDataFile(s:MODE_NAME, 'items')
+  let coverages = fuf#loadDataFile(s:MODE_NAME, 'coverages')
   call insert(coverages, {'name': name, 'patterns': patterns})
-  call fuf#saveDataFile(s:MODE_NAME, 'items', coverages)
+  call fuf#saveDataFile(s:MODE_NAME, 'coverages', coverages)
 endfunction
 
 "
 
 "
 function s:changeCoverage(name)
-  let coverages = fuf#loadDataFile(s:MODE_NAME, 'items')
+  let coverages = fuf#loadDataFile(s:MODE_NAME, 'coverages')
   if a:name !~ '\S'
     let names = map(copy(coverages), 'v:val.name')
     call fuf#callbackitem#launch('', 0, '>Coverage>', s:createChangeCoverageListener(), names, 0)

File autoload/fuf/dir.vim

 endfunction
 
 "
+function fuf#dir#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#dir#renewCache()
   let s:cache = {}
 endfunction

File autoload/fuf/file.vim

 endfunction
 
 "
+function fuf#file#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#file#renewCache()
   let s:cache = {}
 endfunction

File autoload/fuf/givencmd.vim

 endfunction
 
 "
+function fuf#givencmd#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#givencmd#renewCache()
 endfunction
 

File autoload/fuf/givendir.vim

 endfunction
 
 "
+function fuf#givendir#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#givendir#renewCache()
 endfunction
 

File autoload/fuf/givenfile.vim

 endfunction
 
 "
+function fuf#givenfile#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#givenfile#renewCache()
 endfunction
 

File autoload/fuf/help.vim

 endfunction
 
 "
+function fuf#help#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#help#renewCache()
   let s:cache = {}
 endfunction

File autoload/fuf/jumplist.vim

 endfunction
 
 "
+function fuf#jumplist#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#jumplist#renewCache()
 endfunction
 

File autoload/fuf/line.vim

 endfunction
 
 "
+function fuf#line#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#line#renewCache()
 endfunction
 

File autoload/fuf/mrucmd.vim

 endfunction
 
 "
+function fuf#mrucmd#getEditableDataNames()
+  return ['items']
+endfunction
+
+"
 function fuf#mrucmd#renewCache()
 endfunction
 

File autoload/fuf/mrufile.vim

 endfunction
 
 "
+function fuf#mrufile#getEditableDataNames()
+  return ['items']
+endfunction
+
+"
 function fuf#mrufile#renewCache()
   let s:cache = {}
 endfunction

File autoload/fuf/quickfix.vim

 endfunction
 
 "
+function fuf#quickfix#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#quickfix#renewCache()
 endfunction
 

File autoload/fuf/tag.vim

 endfunction
 
 "
+function fuf#tag#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#tag#renewCache()
   let s:cache = {}
 endfunction

File autoload/fuf/taggedfile.vim

 endfunction
 
 "
+function fuf#taggedfile#getEditableDataNames()
+  return []
+endfunction
+
+"
 function fuf#taggedfile#renewCache()
   let s:cache = {}
 endfunction
 4.1:
   - Added Bookmark-Dir mode.
   - Added Bookmark-File mode and removed Bookmark mode.
+  - Changed the filename to store data of Coverage-File mode, from
+    '~/.vim-fuf-data/coveragefile/items' to
+    '~/.vim-fuf-data/coveragefile/coverages' .
 
 4.0:
   - From this version, L9 library (vimscript #3252) is required.