Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gf on visual selection incorrectly includes first trailing character after selection in file name #4823

Closed
daniels opened this issue May 9, 2020 · 0 comments
Assignees
Labels

Comments

@daniels
Copy link

daniels commented May 9, 2020

Describe the bug

When using gf on a visual mode selection, the selection should be used as the filename and the corresponding file should be opened. Instead the selection plus one additional character is used as the filename, causing the expected file not to be matched (and potentially non-expected files to be matched). It does seem to include any trailing character, including spaces, but not newlines.

(A typical example when you would want to use a visual mode selection with gf is when wanting to follow a path including spaces, where the spaces will prevent gf from finding the filename automatically.)

To Reproduce

Given an exsting file target.md and the file test.md with the following content:

[Link to target](target.md)
  1. Open test.md
  2. With cursor inside (target.md) type vi) to select the text target.md
  3. Type gf to open file under cursor
  4. VS Code will display the error "File: target.md) does not exist."

Expected behavior

The file target.md should open in a new tab.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.14.1
  • VSCode version: 1.44.2
  • OS: MacOS High Sierra
@J-Fields J-Fields self-assigned this May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants