From 32d8797d887b0980514cdf7f11c9c1379d597e57 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 30 Dec 2016 23:13:13 -0500 Subject: [PATCH] Check whether :tcd exists before using tab-specific haslocaldir() Closes #197 --- autoload/sy.vim | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/autoload/sy.vim b/autoload/sy.vim index a254ea4..ef50dcb 100644 --- a/autoload/sy.vim +++ b/autoload/sy.vim @@ -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