Skip to content

Commit 204a01a

Browse files
l4zygreedvoldikss
authored andcommitted
fix chdir function for nvim
1 parent f65ad8d commit 204a01a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autoload/floaterm/path.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ function! floaterm#path#get_root(path=getcwd()) abort
136136
endfunction
137137

138138
function! floaterm#path#chdir(path) abort
139-
let l:cd = { 0: 'cd', 1: 'lcd', 2: 'tcd' }[haslocaldir()]
139+
if has('nvim')
140+
let l:cd = haslocaldir()? 'lcd' : (haslocaldir(-1, 0)? 'tcd' : 'cd')
141+
else
142+
let l:cd = { 0: 'cd', 1: 'lcd', 2: 'tcd' }[haslocaldir()]
143+
endif
140144
silent execute l:cd . ' ' . fnameescape(a:path)
141145
endfunction

0 commit comments

Comments
 (0)