From a7e3219de8f603aaec35b30027778aa417fcb691 Mon Sep 17 00:00:00 2001 From: Henry Kupty Date: Thu, 6 Oct 2016 19:51:19 -0300 Subject: [PATCH] Fix tcd breakage This fix is backwards compatible with vim. --- autoload/sy.vim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/autoload/sy.vim b/autoload/sy.vim index 6af5a73..a254ea4 100644 --- a/autoload/sy.vim +++ b/autoload/sy.vim @@ -24,9 +24,18 @@ function! sy#start() abort return endif + + function! s:chdir() + if has('nvim') + return haslocaldir() ? 'lcd' : haslocaldir(-1, 0) ? 'tcd' : 'cd' + else + return haslocaldir() ? 'lcd' : 'cd' + endif + endfunction + " sy_info is used in autoload/sy/repo let b:sy_info = { - \ 'chdir': haslocaldir() ? 'lcd' : 'cd', + \ 'chdir': s:chdir(), \ 'cwd': fnameescape(getcwd()), \ 'dir': fnamemodify(sy_path, ':p:h'), \ 'path': sy#util#escape(sy_path),