Friday, December 14, 2018

TextWrangler multi-file search problems

TextWrangler is the free baby brother of BBEdit, and is a fantastic text editor. On an older computer that runs Mac OS 10.5.7, we’ve been using TextWrangler 3.5.3 to do large-scale web site updates for years because it has multi-file search and replace capabilities that work quickly and smoothly.

Until the last couple of weeks, when the multi-file search broke in very strange ways. I don’t know whether to describe this as a bug, error, corrupt file, issue, or some other term that might lead you here if you are also experiencing this problem. The behavior was that when we press “Find all”, it acts like we chose “Search all”. When we enter a text string that is in one or more files, TextWrangler claims that it’s not present at all. When we enter a text string that is not in any files, TextWrangler brings up every file, highlights nothing (because there is nothing to highlight), and claims that every file contains the string. Choosing case-sensitive or grep did not change the wrong behavior. Choosing small or large file sets did not change the behavior. This was all perfectly consistent and reproducible despite rebooting and reinstallation of TextWrangler 3.5.3.

What finally fixed it was removing a few TextWrangler files from the Library:

Library>Application Support>TextWrangler
Library>Preferences>com.barebones.textwrangler.plist
Library>Preferences>com.barebones.PreferenceData
Library>Caches>com.barebones.textwrangler

After removing those (or renaming them to "problem-[...]" so we still had a copy) and relaunching TextWrangler, the multi-file find no longer got confused with multi-file replace, files turned up and didn’t when they were supposed to, and we were back in business solving actual problems with our web site.

I’m sad that TextWrangler will no longer exist for new computers, even though BBEdit can apparently do even more than TextWrangler ever could. There’s something very satisfying about using software that works (and aside from this short period, TextWrangler has been rock solid) and doesn’t have a huge number of features that I don’t need.