Check whether :tcd exists before using tab-specific haslocaldir()

Closes #197
This commit is contained in:
James McCoy 2016-12-30 23:13:13 -05:00 committed by Marco Hinz
parent 79d867a7a6
commit 32d8797d88

View File

@ -26,11 +26,7 @@ function! sy#start() abort
function! s:chdir()
if has('nvim')
return haslocaldir() ? 'lcd' : haslocaldir(-1, 0) ? 'tcd' : 'cd'
else
return haslocaldir() ? 'lcd' : 'cd'
endif
return haslocaldir() ? 'lcd' : (exists(':tcd') && haslocaldir(-1, 0)) ? 'tcd' : 'cd'
endfunction
" sy_info is used in autoload/sy/repo