macvim-dev / macvim-dev/macvim

Extensions reappear when macvim writes to a file

Offen
#897 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

Describe the bug:

If you have a file for which extensions normally appear in Finder, if you have disabled the showing of the extension on that file, the extension will re-appear when vim writes the file. Reproduced with both gui and non-gui versions of latest release of macvim. This does not occur with /usr/bin/vim.

To reproduce:

Create a file with an extension that is visible on the desktop, eg, foo.wiki. Select the file in finder, and use %-i to show the file information. In the file information box, select 'Hide extension'. The extension will disappear from the desktop name for the file.

Use macvim to open the file. On the first write to the file, the extension '.wiki' will reappear.

If you examine the file in a terminal window with 'ls -l@ filename.extension', prior to the write it will have the extended data
com.apple.FinderInfo 32
After the write this setting no longer appears. Same behavior with both the gui and non-gui usage of macvim.

Do the same test using Apple default /usr/bin/vim rather than mvim, and the extension visibility does not change.

Expected behavior:

The status of Finder's display the extension should not change when macvim writes the file.

Screenshots: none

Environment:

VIM version: VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 18 2019 23:51:40)
OS: macOS Mojave version10.14.5, patched to current
Terminal: iTerm, OSX Terminal app

Additional context:

I checked the gitub sites for both stock vim and macvim. There seems to be no issues (open or closed) which seemed relevant. Given that Apple's version is 8.0 rather than 8.1, it is possible that the bug was introduced after the 8.0 patchlevel 1283 release or that Apple fixed the bug but did not publish the fix.

Given that stock Apple vim works correctly, I chose to report this as a bug rather than a feature request to preserve the macOS extended attribute keys. The latter is actually a broader issue than what I report here, but it seems to me that if a file has extended attributes or security settings, those ought to be preserved as well as the simple extension visibility attribute. Similarly, one could argue that extended security information and file attributes should be applied to the .swp file as well. If you like, I'd be happy to open a feature request on that topic as well.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Schreibvorgang unter macOS mit MacVim zu reproduzieren und ihn mit /usr/bin/vim zu vergleichen, wobei das gemeldete erweiterte Attribut com.apple.FinderInfo als beobachtbarer Unterschied verwendet wird. Verfolge den für den Dateischreibvorgang verantwortlichen Pfad, durch den dieses Attribut verloren geht; fertig ist die Arbeit, wenn die Einstellung für ausgeblendete Erweiterungen im Finder unverändert bleibt, nachdem MacVim die Datei geschrieben hat.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
macos, vim
Bereich
desktop, operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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