comparison src/testdir/test_cd.vim @ 26173:460790b520dd v8.2.3618

patch 8.2.3618: getcwd() is unclear about how 'autochdir' is used Commit: https://github.com/vim/vim/commit/851c7a699ae00bdc14a4db874cf722b7b7393b53 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 18 20:47:31 2021 +0000 patch 8.2.3618: getcwd() is unclear about how 'autochdir' is used Problem: getcwd() is unclear about how 'autochdir' is used. Solution: Update the help for getcwd(). Without any arguments always return the actual current directory. (closes #9142)
author Bram Moolenaar <Bram@vim.org>
date Thu, 18 Nov 2021 22:00:06 +0100
parents bcf55847d2ed
children 40f6330abc2c
comparison
equal deleted inserted replaced
26172:b35f5fdc951b 26173:460790b520dd
223 bwipe! 223 bwipe!
224 exe "bwipe! " .. first_buf 224 exe "bwipe! " .. first_buf
225 call delete('Xa', 'rf') 225 call delete('Xa', 'rf')
226 endfunc 226 endfunc
227 227
228 func Test_getcwd_actual_dir()
229 let startdir = getcwd()
230 call mkdir('Xactual')
231 call test_autochdir()
232 set autochdir
233 edit Xactual/file.txt
234 call assert_match('testdir.Xactual$', getcwd())
235 lcd ..
236 call assert_match('testdir$', getcwd())
237 edit
238 call assert_match('testdir.Xactual$', getcwd())
239 call assert_match('testdir$', getcwd(win_getid()))
240
241 set noautochdir
242 bwipe!
243 call chdir(startdir)
244 call delete('Xactual', 'rf')
245 endfunc
246
228 " vim: shiftwidth=2 sts=2 expandtab 247 " vim: shiftwidth=2 sts=2 expandtab