Vim icon indicating copy to clipboard operation
Vim copied to clipboard

`gf` incorrectly interprets path delimiters on WSL

Open cronsorcery opened this issue 1 year ago • 1 comments

Describe the bug After upgrading to 1.27.0 or later on WSL, gf keybinding opens a new file in the same directory as source file instead of opening the file under the cursor. When saving this file, the name of the file is just an absolute path to the actual file, but with backslashes instead of forward slashes.

Earlier versions don't have this issue, and it is currently present in 1.27.1.

To Reproduce Steps to reproduce the behavior:

  1. Open VSCode with vim extension 1.27.0 or above in WSL
  2. Create two files, one containing path to the second file
  3. Move cursor over this path and press gf
  4. See a new empty file

Expected behavior The file under the cursor should open.

Screenshots

https://github.com/VSCodeVim/Vim/assets/80540375/4fc28a14-0e0f-4e99-ac6f-a71cce0c00f7

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.27.1
  • VSCode version: 1.85.1
  • OS: Windows_NT x64 10.0.22631 (WSL Ubuntu 22.04.3 LTS)

Additional context Add any other context about the problem here.

cronsorcery avatar Dec 21 '23 20:12 cronsorcery

It's due to this pr: feat: gf relative to project root by Foo-x · Pull Request #8705 · VSCodeVim/Vim, I think we can add a configuration: openFilePosition: 'relative' | 'absolute'

HenryTSZ avatar Jan 07 '24 13:01 HenryTSZ