Recently I suffered great irritation when working with HTML files that were generated by Gemini. The code was fine but when I copied it into Notes (the text editor in Mac OS) and started to modify it, problems emerged. This is the diagnosis that Gemini made:
Your experience with TextEdit where the file contents "vanished" or where the code was corrupted strongly suggests TextEdit was defaulting to Rich Text Format (RTF).
RTF: TextEdit is fundamentally a rich text editor. If you don't explicitly set it to Format > Make Plain Text (as I suggested in the last reply), it embeds invisible RTF control codes and automatically introduces characters like U+00A0, turning your clean code into corrupted text.
The Fix: Using a proper code editor (like Visual Studio Code or Sublime Text) or ensuring TextEdit is strictly in Plain Text mode prevents this invisible character corruption from happening in the first place.
The recommendation of Visual Studio Code was decidly overkill. The interface was far too complex for my purposes and so I complained to Gemini and got this response:
I sincerely apologize for the frustration that Visual Studio Code caused. You are absolutely right—for a simple HTML file editor, VS Code's setup can be overwhelming, especially when it pushes you toward GitHub and project management tools. That complexity is definitely a nightmare when you just need to edit a single file.
You needed a simple, dedicated text editor, and I provided a powerhouse development environment. My mistake.
Let me correct this immediately with two genuinely simple, lightweight, and free alternatives for macOS that won't require setting up projects or dealing with Git.
🛠️ Better macOS Code Editors (Simple & Free)
Both of these options are much closer to a straightforward plain text editor than VS Code, but they include the crucial syntax highlighting necessary for web code.
1. CotEditor 🥇 (Top Recommendation)
Best For: Users switching from TextEdit who want maximum simplicity and speed.
Cost: Completely Free.
Key Features:
It's a native macOS app, meaning it looks and feels perfectly integrated with your Mac.
It defaults to Plain Text. This completely eliminates the U+00A0 (non-breaking space) character issues you faced.
It offers excellent syntax highlighting for HTML, CSS, and JavaScript, making your code readable.
It has a clutter-free interface.
Where to Get It: You can download it directly from the Mac App Store.
2. TextMate (Solid Alternative)
Best For: A classic, clean text-editing experience.
Cost: While technically paid, the older version is often used for Free. The official current version offers a free evaluation period.
Key Features:
It was one of the original famous Mac code editors.
It is known for its speed and highly efficient, distraction-free interface.
Perfect for quick edits to single files like your
dashboard.html.Action: I strongly recommend giving CotEditor a try. It is designed to be the friendly, simple, and correct replacement for TextEdit when dealing with code.
I went with CotEditor and this worked just fine. The HTML is very easy to edit and no insertion of invisible codes that cause havoc when the web browser tries to interpret it. A lesson learned.

No comments:
Post a Comment