We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f327ea5 + 4b89f1c commit fb87877Copy full SHA for fb87877
1 file changed
autoload/ctrlp.vim
@@ -1915,8 +1915,20 @@ fu! s:bufwins(bufnr)
1915
retu winns
1916
endf
1917
1918
+fu! s:isabs(path)
1919
+ if (has('win32') || has('win64'))
1920
+ return a:path =~ '^\([a-zA-Z]:\)\{-}[/\\]'
1921
+ el
1922
+ return a:path =~ '^[/\\]'
1923
+ en
1924
+endf
1925
+
1926
fu! s:bufnrfilpath(line)
- let filpath = fnamemodify(a:line, ':p')
1927
+ if s:isabs(a:line)
1928
+ let filpath = fnamemodify(a:line, ':p')
1929
1930
+ let filpath = fnamemodify(s:dyncwd.(&shellslash ? '/' : '\').a:line, ':p')
1931
1932
let bufnr = bufnr('^'.filpath.'$')
1933
if (a:line =~ '[\/]\?\[\d\+\*No Name\]$' && !filereadable(filpath) && bufnr < 1)
1934
let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$'))
0 commit comments