TextWrangler 5.0 Release Notes

TextWrangler 5.0 is a major upgrade which includes significant internal improvements and modernizations, as well as fixes for reported issues. Notable additions and changes are listed below.

For information on changes made in previous versions, please see the release notes archive.

For detailed information on using any of TextWrangler's features, please refer to the user manual (choose "User Manual" from TextWrangler's Help menu).

Requirements

TextWrangler 5.0 requires Mac OS X 10.8.5 or later, and is compatible with OS X 10.11 "El Capitan".

Additions

  • The results windows for Find Differences are all new. Among other things, the old three-window presentation is gone, replaced by a single window which shows both old and new files at the same time, along with the diff list.

    When two folders are compared, the sidebar on the left shows the hierarchy of files and folders that are different. The "Only in Old" and "Only in New" lists are gone; instead, each pair of icons indicates whether an item is missing from one or the other. If so, the arrow on the right-hand side of the item can be used to copy the file or folder over to replace the missing item.

    The Differences window also supports a "widescreen" layout. Although there is no UI for changing the layout at this writing, you can do so through the scripting interface:

    set widescreen of differences_window 1 to (not widescreen of differences_window 1)

    "Save Default Window" also works for Differences window, so if you prefer the widescreen layout, you can use the script to change it, then "Save Default Differences Window" to make it the default.

  • There's a new feature: "Highlight instances of selected text". When you select something (that doesn't consist entirely of whitespace or punctuation), all of the occurrences of the selection are underlined; and the new pair of commands on the Search menu ("Next Occurrence of ", "Previous Occurrence of ") can be used to navigate the occurrences. (This navigation is independent of the text searching UI, although the string is added to the search history for convenience of future use.)

    This feature can be turned on or off globally in the Editing preferences; there is likewise an adjustment for the delay before the highlighting is done.

  • "Zap Gremlins" has been extended to provide the option to use ASCII equivalents when replacing gremlins with the character code (thus replacing the old "Convert to ASCII" command), as well as an option to replace gremlins with HTML entities.

  • Added two new commands to the Edit menu for text views: "Select Up" and "Select Down". These commands facilitate rectangular selection via the keyboard. (Their factory defaults are Control-Shift-uparrow and Control-Shift-downarrow but can be changed as usual in the Menus & Shortcuts prefs.) Given either a single-range selection (that does not cross a line boundary) or an existing rectangular selection, "Select Up" and "Select Down" will extend the selection range up (or down, respectively) in the same column, thus creating (or extending) a rectangular selection.

    These commands are disabled if soft wrapping is turned on in the view.

  • It is now possible for #! text filter scripts to present a dialog box allowing the user to specify arguments to the filter (which the filter script may then use to modify its operation on the input). This is done by creating a Cocoa nib file in Xcode, and placing it in a specific location relative to the script being run (namely, "../Resources/<script base name>.xib"). It is necessary to follow certain specific rules when creating the nib. A separate metadata property list ("../Resources/<script base name>-arguments.plist") may be included in order to specify the format of arguments on the command line.

  • When a Differences window is active, the "Next Error" and "Previous Error" commands on the Go menu change to "Next Difference" and "Previous Difference", and can be used to navigate even when the differences list does not have focus.

  • The "Text Colors" UI has been overhauled to allow for extended colors (and some new core color types have been added).

  • The format of color schemes has changed. Existing color schemes will be converted; note, however, that the new color schemes have many more color settings. Any missing color settings will use factory defaults.

  • The syntax coloring internals have been extensively reworked. Run kinds (used to determine colors) can now be extended by language modules, with each run having a default color and enough metadata to drive the prefs UI. Thus, language module developers are no longer limited by the set of built-in colors.

    This rework required incompatible changes to the language module plug-in API. Language modules that worked with previous versions of TextWrangler may require updates before they will work again.

  • Because PHP can appear in one of two contexts, recognition of PHP has been split between two languages: "PHP", which is used only for "raw" PHP source, and "PHP in HTML", which describes PHP embedded in HTML documents. This should clear up some of the confusion which occurred from having PHP-in-HTML documents sometimes following PHP rules, and sometimes following HTML rules (particularly where clippings are involved).

    Note: If you had previously made changes to the filename extension mappings to explicitly map PHP extensions to "HTML", or HTML extensions to "PHP", you will be well served by clearing those mappings and allowing the factory defaults to prevail.

  • @YES, @NO, @true, and @false are now colored as keywords in Objective-C documents (the latter two only in Objective-C++).

  • Objective-C numeric literals (e.g. @12345) are now colored as numbers in Objective-C/Objective-C++ files.

  • Added __objc_yes and __objc_no to the keyword list for Objective-C/C++

  • Added @import to the keyword list for Objective-C/C++

  • Added nullptr to the keyword list for C++ and Objective-C++.

  • There is a new expert preference: PrecomposeUnicodeWhenPasting. This is useful in situations where you frequently bring in text that contains combining Unicode characters from external sources (such as PDFs generated on other platforms), and need to crush two combining characters into one composed character where possible. This is not a generalized need, but if you run into it often enough, turning on the expert preference will save you some work:

    defaults write com.barebones.textwrangler PrecomposeUnicodeWhenPasting -bool YES

    (Despite the name, the precomposition is done when TextWrangler imports the Clipboard from other applications, not when the paste is actually done.)

    Note that this requires an additional copy of the Clipboard when the application imports the text, and for very large pastes, there may be a noticeable delay while the text gets precomposed. Thus, you should only turn on this setting when you are frequently working with text that contains combining Unicode characters.

  • The UI for "Save Scheme" in the Text Colors preferences has been enhanced: there's now a pop-up menu so that you can choose the name of an existing color scheme if you want to overwrite it. (You'll be warned before overwriting an existing color scheme, though.)

  • Added color settings for verbatim sections and math strings in TeX documents.

  • There are now several built-in factory supplied color schemes. These may be used as-is, according to your preference, or you can select one, customize it, and use "Save Scheme" to create your own modifications (which are stored in the Application Support/Color Schemes/ folder, as usual).

    The "BBEdit Light" color scheme is now the factory default. This is applied when you start up with no existing preferences or when you use the "Reset to Defaults" button in the Text Colors preferences.

    The factory default colors from pre-5 versions are provided as "BBEdit Classic".

  • In the sidebar of a multi-file Differences window, you can now click on a file or folder icon to ask the OS to open it. Hold down the Option key to reveal it in the Finder instead; or hold down the Command key to open the item in TextWrangler (even if the OS would open it in some other application).

  • There is a new control in the status bar at the bottom of text views; it displays the current magnification of the view and allows you to change it. The control can be hidden (or shown) using the "Text Magnification" option in the Appearance preferences.

  • There is now a keyboard equivalent for opening the Magnification menu; this can be changed in the "Menus & Shortcuts" preferences, under "Status Bar".

  • The popup-menu buttons at the bottom of the window side bar are now accessible via keyboard commands. There are none set by default; you can configure your own in the "Menus & Shortcuts" preferences; see the "Side Bar Items" section.

  • There is a third option in the Keyboard preferences to control Home and End key behavior: "Progressive (BRIEF compatible)". If you select this option, the Home and End keys behave as follows on successive presses:

    • the first press will move the insertion point to the beginning (or end) of the current line;

    • the second press will move the insertion point to the begin of the first line (or the end of the last line) in the current page of text, without scrolling;

    • the third press will move the insertion point to the beginning (or end) of the document.

    The behavior is progressive within a specific time period. After the period expires, or if you change the selection range by other means, the behavior state resets, so the next press of Home or End will behave as in the first step described above.

    The factory default timeout period is ten seconds. There is an expert pref to control it:

    defaults write com.barebones.textwrangler BRIEFStateTimeout -float 10.0

  • There are some new commands on the View menu:

    • Collapse All Folds - This will collapse all automatically generated fold regions in the text, whether or not they are contained within other folds. (This is distinct from "Collapse Top-Level Folds", which collapses the top-level folds but leaves any nested folds open.)

    • Collapse Folds Below Level - On the submenu, all available fold levels are shown; choosing one will collapse all of the automatically generated fold regions in the text that are below that fold level. So, for example, Collapse Folds Below Level => 1 will leave the top-level folds open, but will collapse all of the folds below the top level, whether or not they are contained by other folds.

  • Clicking on the document icon in a window's toolbar will now open a spring-loaded info panel which displays basic information about the file, and gives you the ability (for local files only) to rename it, "touch" its creation/modification dates, and change its permissions. Dismiss the panel by clicking outside of it, switching to another window or application, or pressing the Escape key.

  • Added a "Swap" button to the Find Differences dialog box.

  • The info panel (raised by clicking on the document icon in the toolbar) now gets a "Text" tab displaying character, word, and line counts for the document (and if applicable the selection).

  • Clicking on the Text Statistics status bar item will now open a the document information panel with the Text tab pre-selected.

  • A "Get Info" command is now available on the View menu, as well as in the action and contextual menus for file sidebars (for items on disk) and disk browsers. This will display the same info panel that is available by clicking on the file's icon in the toolbar. When applied via action or contextual menu to sidebar items, it is only available for files or folders, and will not show text statistics.

  • There is a new command on the Search menu: "Replace All in Selection". This is enabled when there is a selection in the front document's text view (or in the document immediately behind the Find window). Choosing it will apply a Replace All only to the selected range of text.

  • CSS coloring has been enhanced: numeric values are now colored, as are color specifications (both built-in names and 3/6-digit hex color specifications).

  • SCSS is now supported as a built-in language. This is a superset of the support for CSS, with additional coloring for variables, // comments, as well as completion for the SCSS built-in functions.

    *** Note: If you have installed the third-party SCSS language module, you will need to remove it, since it will otherwise override the built-in support.

  • There are two new commands on the Edit menu: "New Line Before Paragraph" and "New Line After Paragraph". These commands will insert a new line at the beginning of the paragraph(*) containing the start of the selection, or after the end of the paragraph containing the end of the selection, respectively.

    (*) The term "paragraph" is used in the same sense as the Cocoa text system uses it, namely, a line boundary. This is at odds with the conventional definition of a paragraph, but consistent with the OS's interpretation of the term (and thus with other applications that implement the same behavior).

  • Added check box to the Edit -> Insert -> File Contents file panel: "Include separators". This will include a separator between each inserted file's contents, which includes a dashed line and the file's name.

  • There is now a simple way to add language keywords to installed languages without fiddling your fingers in the application package or other off-limits places. As follows:

    • in the Application Support/TextWrangler/ folder, there is a new subfolder, named Custom Keywords. It is created automatically when the application starts.

    • In this folder, place one or more files containing the keywords that you wish to be colored.

    • Each file's name should map it to the appropriate language, e.g. ".js" for JavaScript files. You can have multiple keyword files mapped to the same language, if you wish.

    • Each file should be UTF-8 text, no BOM, and contain one keyword per line.

    • Keyword lookups are case-sensitive if the language is case sensitive; case-insensitive otherwise.

    • Words in these files are colored using the "Language Keywords" color.

  • TextWrangler now supports the EditorConfig settings file convention. You can learn more about this at the EditorConfig web site.

    TextWrangler supports most, but not all, of the core EditorConfig properties listed here. The end_of_line property is not supported; nor is max_line_length.

    In addition to the core EditorConfig properties, there are some TextWrangler-specific additions. First, TextWrangler supports the following keys originating in Emacs:

    • coding: similar to charset, but allows you to specify any IANA character set name.

    • mode: allows you to explicitly specify the language. Many of the Emacs-style mode names work, as long as they correspond to supported languages in TextWrangler. In addition, any installed language in TextWrangler may be expressed as a mode name by lowercasing its name and replacing spaces with dashes. For example, "Ruby in HTML" becomes ruby-in-html; or "Strings File" becomes strings-file.

    • make-backup-files: set to 1 or 0, determines whether TextWrangler makes a backup of the file when saving.

    • backup-inhibited: if present and set to 1, will explicitly suppress the creation of backup files when saving.

    Finally, there are some keys which are explicitly TextWrangler-specific. All of these keys have names that begin with x- in order to prevent collisions with any future core keys. These correspond directly to individual document settings, and if present will override the global preferences:

    • x-typographers-quotes: Use Typographer's Quotes
    • x-balance-while-typing: Balance While Typing
    • x-soft-wrap-text: Soft Wrap Text
    • x-soft-wrap-mode: (string) Must be one of CharacterWidth, WindowWidth, or PageGuide
    • x-soft-wrap-limit: (integer) if the wrap mode is CharacterWidth, specifies the number of characters
    • x-font-name: (string) the display font name
    • x-font-size: (integer) the display font point size
    • x-show-invisibles: Show Invisibles
    • x-show-spaces: Show Spaces

    Unless otherwise noted, these application-specific keys are all Boolean flags.

  • There's a new (dynamic) command on the File menu: "Save All in Window". The factory default keyboard equivalent is Command-Option-Shift-S. This is enabled if any (or the only) document in the front window has unsaved changes; choosing it will save all documents in the front window.

  • The CSS/SCSS language module is all new. Folding, keyword coloring, function navigation, and completion have all been improved. Various bugs are fixed.

  • Added a new command to the first section of the Search menu: "Search in Document’s Folder" (its title when disabled). When a text document is active in the front window, this command is enabled and will activate the Multi-File Search window with the document's enclosing folder selected as the search location. (The name and path to the folder are displayed in the menu.)

  • The "Arrange" item on the Window menu now presents a submenu with all of the available arrangements. Choosing one will apply it; for any that you use frequently, you can assign a keyboard shortcut in the application's "Menus & Shortcuts" preferences.

  • A new language module for EditorConfig files is now built in, with syntax coloring and section navigation (via the function navigation menu).

  • The INI language module has been rewritten, and provides improved navigation as well as folding.

Changes

  • The "Recent Documents" section in the sidebar (in windows that have one) is gone; it has been replaced with a "recent" popup button in the action area at the bottom of the sidebar. The menu on this button shows recently opened documents, up to the maximum number specified in the Application preferences. The Show/Hide Recent Documents command on the View menu has been removed.

  • The "Start Recording"/"Stop Recording" command has been removed from the Script menu; the system-level support for script recording never did quite work correctly in 10.6 and later, and there is no modern equivalent for the (now deprecated) APIs required to support it. Use the corresponding feature in the AppleScript Editor or Script Debugger instead.

  • Renamed "Collapse All Folds" on the View menu to "Collapse Top-Level Folds", because that's what it really does.

  • The "Process Lines Containing" dialog has been rewritten (and rearranged). It now also includes the search history and Grep pattern menus proximate to the search string.

  • The Entab/Detab dialog box has been rewritten (and its layout updated).

  • Rewrote the Add/Remove Line Numbers dialog

  • Changed the "Installed Languages" button in the Languages prefs pane to match the standard system button appearance.

  • Rewrote and modernized the Prefix/Suffix Lines dialog

  • Rewrote the "Hard Wrap" dialog box.

  • Rewrote the "Process Duplicate Lines" sheet.

  • Rewrote the "Sort Lines" sheet.

  • Cocoa-ized "Compare Against Previous Version".

  • The "encoding couldn't be guessed for this document" sheet has been Cocoa-ized.

  • Updated the "Clear Markers" dialog.

  • Rewrote the password panels used for privilege escalation used in password prompts for SSH.

  • Rewrote the "Replace All" options panel for text factories. For bonus points the fields now use the default editor font and have scrollbars.

  • The sheet for adding Grep patterns from the Find or Multi-File Search window has been rewritten. You can choose a pattern from the popup menu to prefill the name (if you wish to replace an existing pattern).

  • Rewrote the Hex Dump dialog. Resource fork dumping has been retired.

  • The "Options" sheet in the Multi-File Search window has been Cocoaized.

  • The modal panel that appears when you click "Replace All" in the Multi-File Search window has been Cocoaized.

  • The "Show Results" option in the modal "Replace All" options panel has been removed; results for multi-file Replace All are always displayed.

  • Rewrote the panel for creating a new item (file or folder) in a disk browser.

  • Rewrote the "New..." panel in FTP/SFTP browsers.

  • Rewrote several of the sheets used by the FTP/SFTP browser window and save panel.

  • The "Find Differences" dialog box has been rewritten. It should behave substantially as before, but now uses the standard Cocoa path controls. (It is in fact a Cocoa dialog box now.)

  • "Set Marker" now uses the new Cocoa panel.

  • The "Find & Mark All" sheet has been rewritten as a Cocoa sheet.

  • "New..." for filters in the Multi-File Search window now uses a window-modal sheet rather than an app-modal dialog box.

  • #pragma mark and its friends in other languages now support the "Xcode style" syntax, in which a leading and/or trailing minus (-) separated from the rest of the mark text by a space, e.g. - this is a mark - will add a menu separator before and/or after the named mark, as indicated.

  • The Open File by Name window no longer attempts an additional search if no results were found and you hit the "Search" button. If the window isn't finding something that you think it should, please contact Tech Support for assistance.

  • The "Capitalize Sentences" option to Change Case is now smarter about capitalizing sentences that begin with something other than a word character. All of the case transformations are now locale- aware for better correctness with non-English and non-Roman writing languages.

  • Changed the mechanics of creating local cache files for FTP/SFTP temps. A file hierarchy for each account/server is created, and the file stored therein. The folder permissions for the hierarchy are 0700 (u+rwx,ao-rwx).

  • The application no longer uses Growl for notifications, since it now runs only on systems where Notifications are available.

  • [...] Restored the long-lost ability to open Finder "text clippings" (created by dragging text to the Finder from any application) into untitled windows by dragging a clipping on to the application's dock or desktop icon.

  • The "New" and "Old" nomenclature for the Find Differences UI has been replaced by "Left" and "Right".

  • When scanning directories to build the cache for Open File by Name and other purposes, ~/Library/ is now skipped to avoid spending time caching data that is not useful.

  • The language-specific preferences overrides (via the upper list in the "Languages" preferences) can now include the display font; so if you like you use (for example) one font for Markdown, one font for Objective-C, one font for HTML, and so on.

  • "Straighten Quotes" now straightens the "lower" Unicode single and double quotes.

  • Commands on the View => Text Display menu apply to both text views in the Differences window.

  • The about box has been rewritten.

  • The #! menu has been rearranged, and some behaviors for running #! scripts have been changed, as follows:

    • "Run…" has been changed to "Run with Options…". This brings up a dialog which lets you control what is done with the script output. The options to "Run in Debugger" and "Run in Terminal" have been removed, since you can do that explicitly from the #! menu itself (and scripts run that way don't get their output back into the application anyway).

    • The "Run File" command has been removed.

    • When running a script from a file, the application will set the current working directory to the one containing the script file. (The old "chdir to script's directory" option has been removed.)

    • "Check Selection Syntax" and "Run Selection Only" have been removed.

    • The AppleScript commands for running #! filters have been removed.

  • If you want to just reveal a file in the Finder by clicking on the document icon in an editing view's toolbar (and bypass the info panel), hold down the Command key while clicking on the icon.

  • Promoted the "Case sensitive" check box in the "Process Duplicate Lines" dialog box, because the setting affects duplicate detection even when not using a Grep pattern to determine the matching string.

  • When creating a new document, the file is created without HFS type and creator metadata, as long as its name maps to something that is recognizable as a text file (either by internal language mapping or the system identifying its filename extension).

  • TextWrangler no longer pays attention to the global system font smoothing setting when drawing text in text views. The existing application-specific expert preferences still work, though; so use those if you need to adjust font smoothing in the application.

  • When a #! script is run, the following environment variables are now set if applicable:

    BBEDIT_ACTIVE_PROJECT: Path to the frontmost (z-order) project document if it's on disk BBEDIT_INSTAPROJECT_ROOT: If the frontmost (z-order) project is an instaproject, this is set instead to the path of the folder represented by the project.

  • Objective-C @property declarations are now flagged as prototypes, so they will only appear in the function menu if "Show function prototypes" is turned on in the Appearance preferences.

  • The application will no longer use the TUTX, utxt, or UTF8 HFS file type codes as determinants of the text encoding used inside the document.

  • The "Go To Line" panel has been rewritten; and you can now enter a line number of the form "xx:yy", in which the "yy" is a character offset into the destination line. If the character offset exceeds the number of characters on the line, the insertion point will be placed at the end of the line.

  • The fourth command on the Search menu is now always "Search in Project or Disk Browser" (its title when disabled). It is only available when a project or disk browser is the active window, and when enabled displays either the project's name or the root directory of the disk browser. Selecting this command will activate the Multi-File Search window with the appropriate item selected as the search location.

  • The previous "Arrange" item on the Window menu has been renamed to "Cascade Windows" to describe what it does. The modified version to "Tile Two Front Windows" remains available, on the Arrange submenu.

Fixes

TextWrangler 5.0 contains fixes for previously reported issues, as well as the following fixes of note for OS X related symptoms:

  • In order to work around a crash on OS X 10.11 (22523205), code which loads, saves, and interprets printing options in saved document state has been removed. (It is in fact the case that these settings were never actually used once loaded.)

  • Worked around a bug in OS X 10.11 (22636752) in which the font panel would open and be unresponsive to clicks, or changes in the font panel would not affect settings in the Preferences window.

  • Worked around a bug in OS X 10.11 (22872931) in which the application was not notified correctly when files were added, removed, or renamed within folders (Clippings, Scripts, Text Filters, and Stationery).

fin