BBEdit: Adjusting soft wrap behaviour on a per-language basis

Posted by Pierre Igot in: Macintosh
May 6th, 2011 • 11:40 am

Following my earlier post, I got some feedback that led me to explore the issue further. And I have found out about a couple of things that can help improve the situation.

One is that, while there is a default application-wide setting (for new files) for soft wrapping in BBEdit’s preferences dialog box, there is also a document-specific dialog box with soft wrapping options that can be brought up for each document using the “Text Options…” command in the “Edit” menu:

Document-specific options

This lets you use a different soft wrapping option for the current document. It’s no help if the application freezes while attempting to open the document, but if it does not freeze (because you chose a default option that avoids the freeze), then you can later on change the soft wrapping option that will be used for that particular document.

Another, more interesting feature is that you can also set soft wrapping options on a per-language basis in BBEdit’s Preferences, under “Languages”:

Language-specific options

Just click on the “Options” button for the language of your choice, and you can set the default soft wrapping option for all documents that happen to be in that particular language.

Since MySQL is a language, you can therefore have a default option for MySQL documents that uses soft wrapping to a character width of 80 for those documents, and still have a general default option for all other documents that uses soft wrapping to the window width.

Since my MySQL dumps come with the “.dump” file extension, I have also added an entry in the bottom half of this “Languages” preference pane that automatically assigns the “MySQL” language to files with the “.dump” extension, so that BBEdit will definitely recognize them as MySQL dumps automatically and use the appropriate soft wrapping option.

And so now I can go back to my preferred default option of soft wrapping to the window width for all documents and not be afraid of BBEdit freezing when I attempt to open a MySQL dump with it.

It effectively fixes the problem that I described in the earlier post for me. But it does not address the issue of why BBEdit freezes in the first place and why it is not able to handle such situations more gracefully.

Thanks to Steve H. for the feedback.


Comments are closed.