Error formatting on save when opened file is a relative path

Offen
#433 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
47/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
vim
Bereich
tooling

Rechercherichtung

The report reproduces this with g:rustfmt_autosave enabled when Vim opens ../a.rs from a subdirectory; :w reports that -stdin- cannot be opened, while :RustFmt produces no output. Start by tracing the rustfmt autosave formatting path and how it passes the current file path to the formatter. Done when saving a relative-path file formats it successfully without the -stdin- write error.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

  • rust.vim version: Using vim-plug; rust.vim master

Steps to reproduce:

.vimrc:

let g:rustfmt_autosave = 1
~ 
❯ mkdir -p foo/bar && cd foo

~/foo 
❯ touch a.rs

~/foo via 🦀 v1.48.0 
❯ cd bar

~/foo/bar 
❯ vim ../a.rs

:w

"-stdin-"
"-stdin-" E212: Can't open file for writing
Press ENTER or type command to continue

:w

"~/foo/a.rs" 1L, 1B written

Opening the file the same way and just doing :RustFmt produces no output.

Vorherrschende Sprache
Vim Script
Sterne
4.2k
Forks
323
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rust-lang/rust.vim

Alle Issues in rust-lang/rust.vim

Ähnliche Issues

Weitere Issues zu DevTools

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.