patch 8.2.3780: ":cd" works differently on MS-Windows
Problem: ":cd" works differently on MS-Windows.
Solution: Add the 'cdhome' option. (closes #9324)
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index 6fc4564..2265894 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -1199,4 +1199,25 @@
bw
endfunc
+" Test for the 'cdhome' option
+func Test_opt_cdhome()
+ if has('unix') || has('vms')
+ throw 'Skipped: only works on non-Unix'
+ endif
+
+ set cdhome&
+ call assert_equal(0, &cdhome)
+ set cdhome
+
+ " This paragraph is copied from Test_cd_no_arg().
+ let path = getcwd()
+ cd
+ call assert_equal($HOME, getcwd())
+ call assert_notequal(path, getcwd())
+ exe 'cd ' .. fnameescape(path)
+ call assert_equal(path, getcwd())
+
+ set cdhome&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab