Thursday, January 6, 2011

A Better Text Find & Replace User Interface

Mark Alldritt:

This design seems to allow one to have a minimalist Find & Replace panel within an editing window while still offering a usable and discoverable range of search options to the user.

Inline Find bars work great for quick searches, but for Find and Replace I want a resizable, moveable window with large fields, large buttons with keyboard shortcuts, etc. It seems like popover-style attached windows combine the disadvantages of both approaches.

Update (2011-01-09): Andy Lee comments.

1 Comment RSS · Twitter


I agree the popover style can be self-defeating if it obscures the document (as I mentioned in my comment on Mark's site). However, a main use of the inline Find bar is its incrementality, which doesn't really make sense with a separate Find window. This is particularly useful for regular expression searches, which Xcode doesn't do inline, but here's an example with Emacs re-builder:

http://twitpic.com/3nnjvt/full

Ignoring the backslash-happy nature of Emacs's regular expression dialect, you can see the matches as you compose your regular expressiosn; re-builder even highlights subexpressions in different colors.

Probably as a result of my nearly 15 years using Emacs I don't share Mark's allergy to big inline dialog-like things, since in Emacs almost every command either takes its input or displays its output by splitting the current window (which Emacs calls a "frame", but nevermind...).

With respect to keyboard equivalents, find and replace is pretty well suited because nearly all of the equivalents you're likely to need are already in a menu. Some probably won't be (toggle regular expression search, ...) but I think that's a reasonable compromise.

The easiest delineation between inline and separate find seems to be single-file versus multifile search, as Xcode does; obviously if you're searching more than one file then placing the search interface inside a single file is silly. Incidentally, multifile search and replace is something Emacs does poorly and for which I always turn to TextWrangler or BBEdit.

Leave a Comment