mirror of
https://github.com/gryf/.vim.git
synced 2025-12-18 03:50:30 +01:00
Plugins update
This commit is contained in:
@@ -31,30 +31,31 @@ let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
|
||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
||||
" Public {{{1
|
||||
fu! ctrlp#line#init()
|
||||
let [bufs, lines] = [ctrlp#allbufs(), []]
|
||||
let [bufs, lines] = [filter(ctrlp#buffers(), 'filereadable(v:val)'), []]
|
||||
for each in bufs
|
||||
let from_file = readfile(each)
|
||||
let [fnamet, from_file] = [fnamemodify(each, ':t'), readfile(each)]
|
||||
cal map(from_file, 'tr(v:val, '' '', '' '')')
|
||||
let [id, len_ff, bufnr] = [1, len(from_file), bufnr('^'.each.'$')]
|
||||
wh id <= len_ff
|
||||
let from_file[id-1] .= ' #:'.bufnr.':'.id
|
||||
let from_file[id-1] .= ' |'.fnamet.'|'.bufnr.':'.id.'|'
|
||||
let id += 1
|
||||
endw
|
||||
cal filter(from_file, 'v:val !~ ''^\s*\t#:\d\+:\d\+$''')
|
||||
cal filter(from_file, 'v:val !~ ''^\s*\t|[^|]\+|\d\+:\d\+|$''')
|
||||
cal extend(lines, from_file)
|
||||
endfo
|
||||
if !hlexists('CtrlPTabExtra')
|
||||
hi link CtrlPTabExtra Comment
|
||||
if has('syntax') && exists('g:syntax_on')
|
||||
if !hlexists('CtrlPTabExtra')
|
||||
hi link CtrlPTabExtra Comment
|
||||
en
|
||||
sy match CtrlPTabExtra '\zs\t.*\ze$'
|
||||
en
|
||||
sy match CtrlPTabExtra '\zs\t.*\ze$'
|
||||
retu lines
|
||||
endf
|
||||
|
||||
fu! ctrlp#line#accept(mode, str)
|
||||
let info = get(split(a:str, '\t#:\ze\d\+:\d\+$'), 1, 0)
|
||||
let bufnr = str2nr(get(split(info, ':'), 0, 0))
|
||||
let linenr = get(split(info, ':'), 1, 0)
|
||||
if bufnr
|
||||
let info = matchlist(a:str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$')
|
||||
let [bufnr, linenr] = [str2nr(get(info, 1)), get(info, 2)]
|
||||
if bufnr > 0
|
||||
cal ctrlp#acceptfile(a:mode, fnamemodify(bufname(bufnr), ':p'), linenr)
|
||||
en
|
||||
endf
|
||||
|
||||
Reference in New Issue
Block a user