Skip to content

Commit 12c53bd

Browse files
committed
Check and append ending slashes
Fixes #434 Fixes #437
1 parent 8903fe5 commit 12c53bd

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

autoload/ctrlp.vim

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,8 @@ fu! s:SetDefTxt()
617617
if s:deftxt == '0' || ( s:deftxt == 1 && !s:ispath ) | retu | en
618618
let txt = s:deftxt
619619
if !type(txt)
620-
let txt = txt && !stridx(s:crfpath, s:dyncwd)
621-
\ ? ctrlp#rmbasedir([s:crfpath])[0] : ''
622-
let txt = txt != '' ? txt.s:lash(s:crfpath) : ''
620+
let path = s:crfpath.s:lash(s:crfpath)
621+
let txt = txt && !stridx(path, s:dyncwd) ? ctrlp#rmbasedir([path])[0] : ''
623622
en
624623
let s:prompt[0] = txt
625624
endf
@@ -1542,7 +1541,7 @@ fu! s:samerootsyml(each, isfile, cwd)
15421541
endf
15431542

15441543
fu! ctrlp#rmbasedir(items)
1545-
let cwd = s:dyncwd.( s:dyncwd !~ '[\/]$' ? s:lash : '' )
1544+
let cwd = s:dyncwd.s:lash()
15461545
if a:items != [] && !stridx(a:items[0], cwd)
15471546
let idx = strlen(cwd)
15481547
retu map(a:items, 'strpart(v:val, idx)')

autoload/ctrlp/dir.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fu! ctrlp#dir#init(...)
7474
endf
7575

7676
fu! ctrlp#dir#accept(mode, str)
77-
let path = a:mode == 'h' ? getcwd() : s:cwd.ctrlp#utils#lash().a:str
77+
let path = a:mode == 'h' ? getcwd() : s:cwd.ctrlp#call('s:lash', s:cwd).a:str
7878
if a:mode =~ 't\|v\|h'
7979
cal ctrlp#exit()
8080
en

0 commit comments

Comments
 (0)