Commits

Takeshi NISHIDA committed 6f5f948

minor fix

Comments (0)

Files changed (4)

autoload/fuf/buffer.vim

 function s:makeItem(nr)
   let fname = (empty(bufname(a:nr))
         \      ? '[No Name]'
-        \      : fnamemodify(bufname(a:nr), ':~:.'))
+        \      : fnamemodify(bufname(a:nr), ':p:~:.'))
   let time = (exists('s:bufTimes[a:nr]') ? s:bufTimes[a:nr] : 0)
   let item = fuf#makePathItem(fname, strftime(g:fuf_timeFormat, time), 0)
   let item.index = a:nr

autoload/fuf/file.vim

 function s:enumNonCurrentItems(dir, bufNrPrev, cache)
   let key = a:dir . 'AVOIDING EMPTY KEY'
   if !exists('a:cache[key]')
-    " NOTE: Comparing filenames is faster than bufnr()
+    " NOTE: Comparing filenames is faster than bufnr('^' . fname . '$')
     let bufNamePrev = bufname(a:bufNrPrev)
     let a:cache[key] =
           \ filter(copy(s:enumItems(a:dir)), 'v:val.word !=# bufNamePrev')

autoload/fuf/mrufile.vim

   if !exists('s:cache[a:item.word]')
     if filereadable(a:item.word)
       let s:cache[a:item.word] = fuf#makePathItem(
-            \ fnamemodify(a:item.word, ':~'), strftime(g:fuf_timeFormat, a:item.time), 0)
+            \ fnamemodify(a:item.word, ':p:~'), strftime(g:fuf_timeFormat, a:item.time), 0)
     else
       let s:cache[a:item.word] = {}
     endif
 
 "
 function s:handler.onModeEnterPost()
-  " NOTE: Comparing filenames is faster than bufnr()
-  let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':~')
+  " NOTE: Comparing filenames is faster than bufnr('^' . fname . '$')
+  let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':p:~')
   let self.items = copy(self.info.data)
   call map(self.items, 's:formatItemUsingCache(v:val)')
   call filter(self.items, '!empty(v:val) && v:val.word !=# bufNamePrev')

autoload/fuf/taggedfile.vim

 
 "
 function s:handler.onModeEnterPost()
-  " NOTE: Comparing filenames is faster than bufnr()
-  let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':~')
+  " NOTE: Comparing filenames is faster than bufnr('^' . fname . '$')
+  let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':p:~:.')
   " NOTE: Don't do this in onModeEnterPre()
   "       because that should return in a short time.
   let self.items = copy(s:enumTaggedFiles(self.tagFiles))