Vim icon indicating copy to clipboard operation
Vim copied to clipboard

`:w filename` doesn't works

Open agowa opened this issue 1 year ago • 0 comments

Describe the bug I tried to save an until now unsaved json document using :w .vscode/settings.json and instead of saving the file the "Save As" dialog popped open. Also I noticed that the suggested filename was "Untitled-1.json". I.E. not even the file name I provided was pre-populated within the "Save As" dialog but instead it pre-populated it using the guessed title vscode assigned the tab. This can also be seen when writing test into a new file and trying to save it with a name other than test e.g. :w something.txt

To Reproduce Steps to reproduce the behavior:

  1. Go to 'File'
  2. Click on 'New File...'
  3. Enter "Lorem ipsum" as the content for that new file (or none, the content is only required for the 2nd part of the filename being ignored entirely, as it'll cause VSCode to "guess" a tab title other than "Untitled-1")
  4. press <ESC>, and enter either of these commands:
  • :w something.txt
  • :w rellative/path/to/something.txt
  • (windows) :w C:/absolute/path/to/something.txt
  • (linux) :w /absolute/path/to/something.txt

Expected behavior The document getting saved using the provided file name and location. And in case where the relative location isn't unique (e.g. multiple folders within the workspace) open the "Save As" dialog BUT prepopulate the name using the provided filename.

Screenshots If applicable, add screenshots to help explain your problem. If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.27.2
  • VSCode version: 1.86.2 (system setup_
  • OS: Windows_NT x64 10.0.17763

Additional context Add any other context about the problem here.

agowa avatar Feb 15 '24 13:02 agowa