`:w filename` doesn't works
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
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:
- Go to 'File'
- Click on 'New File...'
- 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")
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue from a new VS Code file with the :w commands listed, including relative and absolute paths. Trace the extension's handling of :w and the VS Code Save As flow; done means the supplied filename and location are used, or the dialog is opened with that filename prepopulated when the path is ambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100