mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated vim plugins
This commit is contained in:
@ -569,9 +569,14 @@ endf
|
||||
fu! s:MatchedItems(items, pat, limit)
|
||||
let exc = exists('s:crfilerel') ? s:crfilerel : ''
|
||||
let items = s:narrowable() ? s:matched + s:mdata[3] : a:items
|
||||
if s:matcher != {}
|
||||
let matcher = s:getextvar('matcher')
|
||||
if empty(matcher) || type(matcher) != 4 || !has_key(matcher, 'match')
|
||||
unlet matcher
|
||||
let matcher = s:matcher
|
||||
en
|
||||
if matcher != {}
|
||||
let argms =
|
||||
\ has_key(s:matcher, 'arg_type') && s:matcher['arg_type'] == 'dict' ? [{
|
||||
\ has_key(matcher, 'arg_type') && matcher['arg_type'] == 'dict' ? [{
|
||||
\ 'items': items,
|
||||
\ 'str': a:pat,
|
||||
\ 'limit': a:limit,
|
||||
@ -580,7 +585,7 @@ fu! s:MatchedItems(items, pat, limit)
|
||||
\ 'crfile': exc,
|
||||
\ 'regex': s:regexp,
|
||||
\ }] : [items, a:pat, a:limit, s:mmode(), s:ispath, exc, s:regexp]
|
||||
let lines = call(s:matcher['match'], argms, s:matcher)
|
||||
let lines = call(matcher['match'], argms, matcher)
|
||||
el
|
||||
let lines = s:MatchIt(items, a:pat, a:limit, exc)
|
||||
en
|
||||
@ -1196,7 +1201,7 @@ fu! s:AcceptSelection(action)
|
||||
let type = exttype == 'dict' ? exttype : 'list'
|
||||
en
|
||||
en
|
||||
let actargs = type == 'dict' ? [{ 'action': md, 'line': line, 'icr': icr }]
|
||||
let actargs = type == 'dict' ? [{ 'action': md, 'line': line, 'icr': icr, 'input': str}]
|
||||
\ : [md, line]
|
||||
cal call(actfunc, actargs)
|
||||
endf
|
||||
@ -1873,6 +1878,11 @@ fu! s:highlight(pat, grp)
|
||||
en
|
||||
|
||||
cal matchadd('CtrlPLinePre', '^>')
|
||||
elseif !empty(a:pat) && s:regexp &&
|
||||
\ exists('g:ctrlp_regex_always_higlight') &&
|
||||
\ g:ctrlp_regex_always_higlight
|
||||
let pat = substitute(a:pat, '\\\@<!\^', '^> \\zs', 'g')
|
||||
cal matchadd(a:grp, ( s:martcs == '' ? '\c' : '\C').pat)
|
||||
en
|
||||
endf
|
||||
|
||||
@ -2494,7 +2504,9 @@ endf
|
||||
fu! s:getextvar(key)
|
||||
if s:itemtype >= len(s:coretypes) && len(g:ctrlp_ext_vars) > 0
|
||||
let vars = g:ctrlp_ext_vars[s:itemtype - len(s:coretypes)]
|
||||
retu has_key(vars, a:key) ? vars[a:key] : -1
|
||||
if has_key(vars, a:key)
|
||||
retu vars[a:key]
|
||||
en
|
||||
en
|
||||
retu get(g:, 'ctrlp_' . s:matchtype . '_' . a:key, -1)
|
||||
endf
|
||||
|
@ -139,7 +139,7 @@ fu! s:exectags(cmd)
|
||||
endf
|
||||
|
||||
fu! s:exectagsonfile(fname, ftype)
|
||||
let [ags, ft] = ['-f - --sort=no --excmd=pattern --fields=nKs --extra= ', a:ftype]
|
||||
let [ags, ft] = ['-f - --sort=no --excmd=pattern --fields=nKs --extra= --file-scope=yes ', a:ftype]
|
||||
if type(s:types[ft]) == 1
|
||||
let ags .= s:types[ft]
|
||||
let bin = s:bin
|
||||
|
@ -13,6 +13,7 @@ let g:loaded_ctrlp_line = 1
|
||||
cal add(g:ctrlp_ext_vars, {
|
||||
\ 'init': 'ctrlp#line#init(s:crbufnr)',
|
||||
\ 'accept': 'ctrlp#line#accept',
|
||||
\ 'act_farg' : 'dict',
|
||||
\ 'lname': 'lines',
|
||||
\ 'sname': 'lns',
|
||||
\ 'type': 'tabe',
|
||||
@ -50,11 +51,17 @@ fu! ctrlp#line#init(bufnr)
|
||||
retu lines
|
||||
endf
|
||||
|
||||
fu! ctrlp#line#accept(mode, str)
|
||||
let info = matchlist(a:str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$')
|
||||
fu! ctrlp#line#accept(dict)
|
||||
let mode = a:dict['action']
|
||||
let str = a:dict['line']
|
||||
let input = a:dict['input']
|
||||
let info = matchlist(str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$')
|
||||
let bufnr = str2nr(get(info, 1))
|
||||
if bufnr
|
||||
cal ctrlp#acceptfile(a:mode, bufnr, get(info, 2))
|
||||
cal ctrlp#acceptfile(mode, bufnr, get(info, 2))
|
||||
let @/ = input
|
||||
call search(input, 'c')
|
||||
call histadd("search", input)
|
||||
en
|
||||
endf
|
||||
|
||||
|
Reference in New Issue
Block a user