Also split if the buffer isn't writable
This commit is contained in:
parent
1fd3760b94
commit
767368d5e7
@ -1529,9 +1529,9 @@ fu! ctrlp#normcmd(cmd, ...)
|
||||
retu a:0 ? a:1 : 'bo vne'
|
||||
endf
|
||||
|
||||
fu! ctrlp#modfilecond()
|
||||
retu &mod && !&hid && &bh != 'hide' && !&cf && !&awa
|
||||
\ && s:bufwins(bufnr('%')) == 1
|
||||
fu! ctrlp#modfilecond(w)
|
||||
retu &mod && !&hid && &bh != 'hide' && s:bufwins(bufnr('%')) == 1 && !&cf &&
|
||||
\ ( ( !&awa && a:w ) || filewritable(fnamemodify(bufname('%'), ':p')) != 1 )
|
||||
endf
|
||||
|
||||
fu! s:nosplit()
|
||||
@ -1787,8 +1787,10 @@ fu! s:buffunc(e)
|
||||
endf
|
||||
|
||||
fu! s:openfile(cmd, fid, tail, chkmod, ...)
|
||||
let cmd = a:chkmod && a:cmd =~ '^[eb]$' && ctrlp#modfilecond()
|
||||
\ && !( a:cmd == 'b' && &aw ) ? ( a:cmd == 'b' ? 'sb' : 'sp' ) : a:cmd
|
||||
let cmd = a:cmd
|
||||
if a:chkmod && cmd =~ '^[eb]$' && ctrlp#modfilecond(!( cmd == 'b' && &aw ))
|
||||
let cmd = cmd == 'b' ? 'sb' : 'sp'
|
||||
en
|
||||
let cmd = cmd =~ '^tab' ? ctrlp#tabcount().cmd : cmd
|
||||
let j2l = a:0 && a:1[0] ? a:1[1] : 0
|
||||
exe cmd.( a:0 && a:1[0] ? '' : a:tail ) ctrlp#fnesc(a:fid)
|
||||
|
@ -47,7 +47,7 @@ fu! ctrlp#quickfix#accept(mode, str)
|
||||
cal ctrlp#exit()
|
||||
let cmd = md == 't' ? 'tabe' : md == 'h' ? 'new' : md == 'v' ? 'vne'
|
||||
\ : ctrlp#normcmd('e')
|
||||
let cmd = cmd == 'e' && ctrlp#modfilecond() ? 'new' : cmd
|
||||
let cmd = cmd == 'e' && ctrlp#modfilecond(1) ? 'new' : cmd
|
||||
exe cmd ctrlp#fnesc(filpath)
|
||||
cal cursor(items[2], items[3])
|
||||
sil! norm! zvzz
|
||||
|
@ -97,7 +97,7 @@ fu! ctrlp#tag#accept(mode, str)
|
||||
\ 'e': ['', 'tj'],
|
||||
\ }
|
||||
let cmd = fnd[0] == 1 ? cmds[a:mode][0] : cmds[a:mode][1]
|
||||
let cmd = a:mode == 'e' && ctrlp#modfilecond() && !&aw
|
||||
let cmd = a:mode == 'e' && ctrlp#modfilecond(!&aw)
|
||||
\ ? ( cmd == 'tj' ? 'stj' : 'sp' ) : cmd
|
||||
let cmd = a:mode == 't' ? ctrlp#tabcount().cmd : cmd
|
||||
if fnd[0] == 1
|
||||
|
Loading…
Reference in New Issue
Block a user