aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_cd.vim
Commit message (Collapse)AuthorAge
* feat(cwd)!: :lcd! (bang), rearrange :bcd/:lcd/… scope precedence #41194Justin M. Keyes2026-08-07
| | | | | | | | | | | | | | | | Problem: - buf-local CWD scope is lower priority than :lcd, which is weird. ``` win > buf > tab > global ``` - No way to clear current CWD at a given scope. Solution: - Rerrange scope precedence to: ``` buf > win > tab > global ``` - Introduce "bang" variants (`:bcd!`/`:lcd!`/`:tcd!`) which clears the local CWD for the given scope.
* feat(cwd): support explicit chdir (:bcd/:tcd/…) in temp contextJustin M. Keyes2026-08-06
| | | | | | | | | | | | | | | | | | Problem: - Explicit `:bcd` (etc.) persists from `nvim_buf_call()` but not from an autocmd handler targeting a hidden buf (`LspAttach`, `TermRequest`, …), which needs a `vim.schedule()` workaround. - `vim._with()` is supposed to work as a "sandbox", discarding side-effects, but it leaks CWD changes: `:lcd` from a `win` context, any chdir from a visible-buffer context. Solution: - Explicit :cd/:tcd/:bcd during a temp context persists by default. - "Ambient" directory changes ('autochdir', existing win-local CWD, etc.) are still undone, as before. - Add `kCtxKeepDirs`: snapshot/restore the target's full CWD state (w/b/tp-local, global, cwd). Used by `vim._with()` and `'inccommand'`, which must not leak state.
* vim-patch:9.2.0675: tests: Test_cd_from_non_existing_dir() fails on Solariszeertzjq2026-06-19
| | | | | | | | | | | | | | Problem: tests: Test_cd_from_non_existing_dir() fails on Solaris Solution: Skip the test on Solaris (Vladimír Marek). Test_cd_from_non_existing_dir() depends on deleting the current working directory. Solaris does not allow that, so skip the test there. closes: vim/vim#20563 https://github.com/vim/vim/commit/b464c36bf976d8f5c7d42371704e487c65f905f4 Co-authored-by: Vladimír Marek <vlmarek13@gmail.com>
* vim-patch:9.2.0531: tests: Test_cd_completion() fails on MS-Windows with E344zeertzjq2026-05-26
| | | | | | | | | | | | | | Problem: tests: Test_cd_completion() fails on MS-Windows with E344 Solution: Catch E344 in addition to E472 (Ken Takata) Sometimes, Test_cd_completion fails with E344: https://github.com/vim/vim-win32-installer/issues/446#issuecomment-4526975345 closes: vim/vim#20328 https://github.com/vim/vim/commit/98401467a996e174d2cb741c9c7d597003e53248 Co-authored-by: K.Takata <kentkt@csc.jp>
* vim-patch:9.2.0020: Wrong shortened buffer after :cd with duplicate slashes ↵zeertzjq2026-02-19
| | | | | | | | | | | | | | | (#37955) Problem: Wrong shortened buffer name after :cd with duplicate slashes. Solution: Skip over multiple consecutive path separators (zeertzjq). related: neovim/neovim#37080 closes: vim/vim#19444 https://github.com/vim/vim/commit/f245e17ac70df43fd7fe650c7227bb16a4615283 N/A patches: vim-patch:9.0.1859: heap-use-after-free in bt_normal() vim-patch:9.2.0022: bt_quickfix() is slow
* vim-patch:9.1.2138: win_execute() and 'autochdir' can corrupt buffer name ↵zeertzjq2026-02-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#37767) Problem: With 'autochdir' win_execute() can corrupt the buffer name, causing :write to use wrong path. Solution: Save and restore b_fname when 'autochdir' is active (Ingo Karkat). This is caused by a bad interaction of the 'autochdir' behavior, overriding of the current directory via :lchdir, and the temporary window switching done by win_execute(), manifesting when e.g. a custom completion inspects other buffers: 1. In the initial state after the :lcd .. we have curbuf->b_fname = "Xsubdir/file". 2. do_autochdir() is invoked, temporarily undoing the :lcd .., changing back into the Xsubdir/ subdirectory. 3. win_execute() switches windows, triggering win_enter_ext() → win_fix_current_dir() → shorten_fnames(TRUE) 4. shorten_fnames() processes *all* buffers 5. shorten_buf_fname() makes the filename relative to the current (wrong) directory; b_fname becomes "file" instead of "Xsubdir/file" 6. Directory restoration correctly restores working directory via mch_chdir() (skipping a second do_autochdir() invocation because apply_acd is FALSE), but b_fname remains corrupted, with the "Xsubdir/" part missing. 7. expand("%:p") (and commands like :write) continue to use the corrupted filename, resolving to a wrong path that's missing the "Xsubdir/" part. To fix the problem the short filename is saved if its in effect (i.e. pointed to by curbuf->b_fname) and 'autochdir' happened. It's then restored in case of a local cwd override. The conditions limit this workaround to when 'autochdir' is active *and* overridden by a :lchdir. closes: vim/vim#19343 https://github.com/vim/vim/commit/abb4d740338e667991656e3ca575e623aba7bd2a Co-authored-by: Ingo Karkat <swdev@ingo-karkat.de>
* vim-patch:9.1.2051: tests: fix Test_cd_completion fails in Appveyor (#37266)zeertzjq2026-01-06
| | | | | | | | | | | | | Problem: Test_cd_completion test fails in Appveyor. In Appveyor, a path containing spaces was selected as the test target. But the comparison failed because spaces were not taken into account (after v9.1.2050) Solution: Escape spaces in paths for comparison (Muraoka Taro) closes: vim/vim#19087 https://github.com/vim/vim/commit/679c2c01faab2b2106ecd7c1038efa031158b93b Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
* vim-patch:9.1.2050: tests: Test_cd_completion may failzeertzjq2026-01-04
| | | | | | | | | | | | | | | | | | | | Problem: tests: Test_cd_completion() may fail depending on the contents of the root directory of the current drive on Windows. readdir() may return a directory that cannot "cd" to, causing this test to fail. An example of such a directory is "System Volume Information" which only admin can "cd" to. Solution: When determining the directory to use for testing, use the directory that we actually "cd" to successfully. In addition, directories with '$' in their names are also excluded, as they are considered environment variables during completion and do not work as expected. Example: "$RECYCLE.BIN" (Muraoka Taro). closes: vim/vim#19078 https://github.com/vim/vim/commit/6625ba359e33f8223d146f3ae87a880c446b5470 Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
* vim-patch:9.1.1648: MS-Windows: some style issues with patch v9.1.1646zeertzjq2026-01-04
| | | | | | | | | Problem: MS-Windows: some style issues with patch v9.1.1646 Solution: Fix typose and code style issues (zeertzjq). closes: vim/vim#18036 https://github.com/vim/vim/commit/14afa278c1bcb2df51b647ffda2821c5294eb7ff
* vim-patch:9.1.1646: MS-Windows: completion cannot handle implicit drive letterszeertzjq2026-01-04
| | | | | | | | | | | | Problem: MS-Windows: completion cannot handle implicit drive letters Solution: Consider paths like \folder and /folder as absolute (Miguel Barro). closes: vim/vim#17829 https://github.com/vim/vim/commit/a2f13bf782f723e116c5d4cc7d79a23e918a24db Co-authored-by: Miguel Barro <miguel.barro@live.com>
* vim-patch:9.1.1605: cannot specify scope for chdir() (#35239)zeertzjq2025-08-08
| | | | | | | | | | Problem: Cannot specify scope for chdir() Solution: Add optional scope argument (kuuote) closes: vim/vim#17888 https://github.com/vim/vim/commit/8a65a49d509d5a9dd5759a4287969896e8941c10 Co-authored-by: kuuote <znmxodq1@gmail.com>
* vim-patch:9.1.1507: symlinks are resolved on :cd commands (#34758)glepnir2025-07-04
| | | | | | | | | | | | | Problem: File paths change from symlink to target path after :cd command when editing files through symbolic links Solution: Add "~" flag to 'cpoptions' to control symlink resolution. When not included (default), symlinks are resolved maintaining backward compatibility. When included, symlinks are preserved providing the improved behavior. (glepnir) related: neovim/neovim#15695 closes: vim/vim#17628 https://github.com/vim/vim/commit/4ade668fb62ebf3f8be537fe451caed6bd1eba9a
* vim-patch:9.1.0568: Cannot expand paths from 'cdpath' settingzeertzjq2024-07-12
| | | | | | | | | | | | | | Problem: Cannot expand paths from 'cdpath' setting (Daniel Hahler) Solution: Implement 'cdpath' completion, add the new 'dir_in_path' completion type (LemonBoy) fixes vim/vim#374 closes: vim/vim#15205 https://github.com/vim/vim/commit/a20bf69a3b32024cb7809be87af33bf9dc490a19 Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:partial:9.0.0418: manually deleting temp test fileszeertzjq2024-07-12
| | | | | | | | | | | Problem: Manually deleting temp test files. Solution: Use the 'D' flag of writefile() and mkdir(). https://github.com/vim/vim/commit/45bbaef0382c5468d9fac511775bd99ea7bf5b84 This only includes test_cd.vim changes. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:partial:9.0.0323: using common name in tests leads to flaky testszeertzjq2024-07-12
| | | | | | | | | | | Problem: Using common name in tests leads to flaky tests. Solution: Rename files and directories to be more specific. https://github.com/vim/vim/commit/3b0d70f4ff436cb144683dafd956e8a3ee485a90 This only includes test_cd.vim changes. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.0634: crash with null partial and blobzeertzjq2023-04-15
| | | | | | | | | | Problem: Crash with null partial and blob. Solution: Check for NULL pointer. Add more tests. (Yegappan Lakshmanan, closes vim/vim#5984) https://github.com/vim/vim/commit/92b83ccfda7a1d654ccaaf161a9c8a8e01fbcf76 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* test: move oldtests to test directory (#22536)dundargoc2023-03-07
The new oldtest directory is in test/old/testdir. The reason for this is that many tests have hardcoded the parent directory name to be 'testdir'.