Thursday, November 8, 2012

Making a better Find and Replace



I've been questioned several times why I use geany the project is old, lacks tons of features and features to make it easy like eclipse, and isn't built in like vi, or gedit.

The reason I use it is an unparalleled find and replace dialog that simply works as you'd expect it to:


The dialog is simple, a search and replace field where you can replace things over the document, or if you want, you may replace over all open windows, or the selection if you expand the "replace all" tab.

You can also use escape sequences to quickly replace things like tabs or newlines, or turn them off to replace escape sequences in lines of code.

Gedit's replace dialog is a little more sparse, not allowing you to replace the current selection (something that is incredibly useful), like when one block of code has a duplicate variable name but you don't want to replace it over the whole document.





Eclipse is an entirely different story. Unlike a normal find and replace, it isn't brought up with a control + h, but instead a control + f (what is normally just find, control + h just brings up a search dialog) The "Selected Lines" radio button doesn't always work either.



I'd like to suggest a few improvements to all of these dialogs too.
  • Show the users all options, but hide complexity by discoloring buttons that don't apply (like
  • Use a menu that looks the same for find and replace.
  • Kill off the "close" button, everyone knows to do this using the "x" (unless the dialog doesn't have one, in which case it shouldn't be inline with the other buttons)
  • Don't use radio buttons for boolean choices, they waste space
  • Don't have a simple replace button, it disturbs the workflow.
  • Don't have a choice for wrap-around, rather notify the user in an unobtrusive way they've reached the end, such as a red bar that shows at the top of the dialog.
  • Allow replacing in all open documents/selected areas
  • Get rid of the labels in favor of text that disappears when the user enters something

Here is what I had in mind for find:






And replace:

No comments:

Post a Comment