mirror of
https://github.com/gryf/.vim.git
synced 2025-12-18 03:50:30 +01:00
- updated FuzzyFinder
- moved Pydoc to ftplugin/python - updated pyflakes - added Pygments feature into rst functions
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
"=============================================================================
|
||||
" Copyright (c) 2007-2009 Takeshi NISHIDA
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if exists('g:loaded_autoload_fuf_file') || v:version < 702
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
let g:loaded_autoload_fuf_file = 1
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
@@ -23,6 +22,11 @@ function fuf#file#getSwitchOrder()
|
||||
return g:fuf_file_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#file#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#file#renewCache()
|
||||
let s:cache = {}
|
||||
@@ -35,9 +39,9 @@ endfunction
|
||||
|
||||
"
|
||||
function fuf#file#onInit()
|
||||
call fuf#defineLaunchCommand('FufFile' , s:MODE_NAME, '""')
|
||||
call fuf#defineLaunchCommand('FufFileWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')')
|
||||
call fuf#defineLaunchCommand('FufFileWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]')
|
||||
call fuf#defineLaunchCommand('FufFile' , s:MODE_NAME, '""', [])
|
||||
call fuf#defineLaunchCommand('FufFileWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')', [])
|
||||
call fuf#defineLaunchCommand('FufFileWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
@@ -48,7 +52,7 @@ let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:enumItems(dir)
|
||||
let key = getcwd() . g:fuf_file_exclude . "\n" . a:dir
|
||||
let key = join([getcwd(), g:fuf_ignoreCase, g:fuf_file_exclude, a:dir], "\n")
|
||||
if !exists('s:cache[key]')
|
||||
let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, g:fuf_file_exclude)
|
||||
call fuf#mapToSetSerialIndex(s:cache[key], 1)
|
||||
@@ -58,15 +62,13 @@ function s:enumItems(dir)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:enumNonCurrentItems(dir, bufNr, cache)
|
||||
function s:enumNonCurrentItems(dir, bufNrPrev, cache)
|
||||
let key = a:dir . 'AVOIDING EMPTY KEY'
|
||||
if !exists('a:cache[key]')
|
||||
" NOTE: filtering should be done with
|
||||
" 'bufnr("^" . v:val.word . "$") != a:bufNr'.
|
||||
" But it takes a lot of time!
|
||||
let bufName = bufname(a: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 != bufName')
|
||||
\ filter(copy(s:enumItems(a:dir)), 'v:val.word !=# bufNamePrev')
|
||||
endif
|
||||
return a:cache[key]
|
||||
endfunction
|
||||
@@ -84,7 +86,7 @@ endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_file_prompt, self.partialMatching)
|
||||
return fuf#formatPrompt(g:fuf_file_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
@@ -93,8 +95,8 @@ function s:handler.getPreviewHeight()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.targetsPath()
|
||||
return 1
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return a:enteredPattern =~# '[^/\\]$'
|
||||
endfunction
|
||||
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user