HeadlinesBriefing favicon HeadlinesBriefing.com

Fix TextMate 2 Fold Corruption with Xattr

DEV Community •
×

TextMate 2 users encountering corrupted fold markers can resolve the issue by removing a hidden file attribute. A simple command-line fix clears the `com.macromates.folded` extended attribute, which tracks closed code folds. This addresses a common workflow problem when external tools modify files while TextMate 2 has them open with folds collapsed.

The problem occurs when another application alters a file TextMate 2 is editing. The editor's fold state, stored in macOS extended attributes, can become out of sync, leading to misplaced or broken fold markers. This solution restores the file's integrity without losing work, leveraging a standard macOS feature for developer tool persistence.

To fix it, close the file in TextMate 2, open Terminal, and run `xattr -d com.macromates.folded <your filename>`. Reopen the file, and the folds will reset cleanly. This practical tip underscores how understanding a tool's underlying OS integration can solve frustrating UI glitches, especially for developers who frequently switch between IDEs and command-line editors.