Extend tabpage_position
This commit is contained in:
parent
5e4bfa660b
commit
da09f4b415
@ -1023,6 +1023,9 @@ fu! s:OpenMulti(...)
|
|||||||
let [ic, cmds] = [1, { 'v': ['vert sb', 'vne'], 'h': ['sb', 'new'],
|
let [ic, cmds] = [1, { 'v': ['vert sb', 'vne'], 'h': ['sb', 'new'],
|
||||||
\ 't': ['tab sb', 'tabe'] }]
|
\ 't': ['tab sb', 'tabe'] }]
|
||||||
let [swb, &swb] = [&swb, '']
|
let [swb, &swb] = [&swb, '']
|
||||||
|
if md == 't' && ctrlp#tabcount() < tabpagenr()
|
||||||
|
let s:tabct = ctrlp#tabcount()
|
||||||
|
en
|
||||||
" Open the files
|
" Open the files
|
||||||
for va in mkd
|
for va in mkd
|
||||||
let bufnr = bufnr('^'.va.'$')
|
let bufnr = bufnr('^'.va.'$')
|
||||||
@ -1044,7 +1047,7 @@ fu! s:OpenMulti(...)
|
|||||||
if jf | if ic == 2
|
if jf | if ic == 2
|
||||||
let crpos = [tabpagenr(), winnr()]
|
let crpos = [tabpagenr(), winnr()]
|
||||||
el
|
el
|
||||||
let crpos[0] += tabpagenr() == crpos[0]
|
let crpos[0] += tabpagenr() <= crpos[0]
|
||||||
let crpos[1] += winnr() == crpos[1]
|
let crpos[1] += winnr() == crpos[1]
|
||||||
en | en
|
en | en
|
||||||
en
|
en
|
||||||
@ -1053,6 +1056,7 @@ fu! s:OpenMulti(...)
|
|||||||
exe ( md == 't' ? 'tabn '.crpos[0] : crpos[1].'winc w' )
|
exe ( md == 't' ? 'tabn '.crpos[0] : crpos[1].'winc w' )
|
||||||
en
|
en
|
||||||
let &swb = swb
|
let &swb = swb
|
||||||
|
unl! s:tabct
|
||||||
endf
|
endf
|
||||||
" ** Helper functions {{{1
|
" ** Helper functions {{{1
|
||||||
" Sorting {{{2
|
" Sorting {{{2
|
||||||
@ -1728,9 +1732,23 @@ fu! s:openfile(cmd, fid, tail, ...)
|
|||||||
endf
|
endf
|
||||||
|
|
||||||
fu! ctrlp#tabcount()
|
fu! ctrlp#tabcount()
|
||||||
retu
|
if exists('s:tabct')
|
||||||
\ s:tabpage == 'al' ? tabpagenr('$') :
|
let tabct = s:tabct
|
||||||
\ s:tabpage == 'ac' ? '' : ''
|
let s:tabct += 1
|
||||||
|
elsei !type(s:tabpage)
|
||||||
|
let tabct = s:tabpage
|
||||||
|
elsei type(s:tabpage) == 1
|
||||||
|
let tabpos =
|
||||||
|
\ s:tabpage =~ 'c' ? tabpagenr() :
|
||||||
|
\ s:tabpage =~ 'f' ? 1 :
|
||||||
|
\ s:tabpage =~ 'l' ? tabpagenr('$') :
|
||||||
|
\ tabpagenr()
|
||||||
|
let tabct =
|
||||||
|
\ s:tabpage =~ 'a' ? tabpos :
|
||||||
|
\ s:tabpage =~ 'b' ? tabpos - 1 :
|
||||||
|
\ tabpos
|
||||||
|
en
|
||||||
|
retu tabct < 0 ? 0 : tabct
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! s:settype(type)
|
fu! s:settype(type)
|
||||||
|
@ -150,8 +150,11 @@ Example: >
|
|||||||
Where to put the new tab page when opening one: >
|
Where to put the new tab page when opening one: >
|
||||||
let g:ctrlp_tabpage_position = 'ac'
|
let g:ctrlp_tabpage_position = 'ac'
|
||||||
<
|
<
|
||||||
al - after the last tab page.
|
a - after.
|
||||||
ac - after the current tab page.
|
b - before.
|
||||||
|
c - the current tab page.
|
||||||
|
l - the last tab page.
|
||||||
|
f - the first tab page.
|
||||||
|
|
||||||
*'g:ctrlp_working_path_mode'*
|
*'g:ctrlp_working_path_mode'*
|
||||||
When starting up, CtrlP sets its local working directory according to this
|
When starting up, CtrlP sets its local working directory according to this
|
||||||
|
Loading…
x
Reference in New Issue
Block a user